use of java.io.FileFilter in project jackrabbit by apache.
the class LocalFileSystem method listFolders.
/**
* {@inheritDoc}
*/
public String[] listFolders(String folderPath) throws FileSystemException {
File file = new File(root, osPath(folderPath));
File[] folders = file.listFiles(new FileFilter() {
public boolean accept(File f) {
return f.isDirectory();
}
});
if (folders == null) {
String msg = folderPath + " does not denote a folder";
log.debug(msg);
throw new FileSystemException(msg);
}
String[] entries = new String[folders.length];
for (int i = 0; i < folders.length; i++) {
entries[i] = folders[i].getName();
}
return entries;
}
use of java.io.FileFilter in project lucene-solr by apache.
the class DirectUpdateHandlerOptimizeTest method assertNumSegments.
private void assertNumSegments(String indexDir, int numSegs) {
File file = new File(indexDir);
File[] segs = file.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().endsWith("cfs");
}
});
//
// TODO: we need a method that does not rely on physical inspection of the directory.
//
// assertTrue("Wrong number of segments: " + segs.length + " does not equal: " + numSegs, segs.length == numSegs);
}
use of java.io.FileFilter in project poi by apache.
the class TestPPTX2PNG method data.
@Parameters(name = "{0}")
public static Collection<String> data() {
final Set<String> data = new TreeSet<String>();
for (String f : files.split(", ?")) {
if (basedir == null) {
data.add(f);
} else {
final Pattern p = Pattern.compile(f);
basedir.listFiles(new FileFilter() {
public boolean accept(File pathname) {
String name = pathname.getName();
if (p.matcher(name).matches()) {
data.add(name);
}
return false;
}
});
}
}
return data;
}
use of java.io.FileFilter in project carbondata by apache.
the class SingleThreadFinalSortFilesMerger method startFinalMerge.
/**
* This method will be used to merger the merged files
*
* @throws CarbonSortKeyAndGroupByException
*/
public void startFinalMerge() throws CarbonDataWriterException {
// get all the merged files
File file = new File(tempFileLocation);
File[] fileList = file.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().startsWith(tableName);
}
});
if (null == fileList || fileList.length == 0) {
return;
}
startSorting(fileList);
}
use of java.io.FileFilter in project carbondata by apache.
the class LocalCarbonFile method listFiles.
@Override
public CarbonFile[] listFiles(final CarbonFileFilter fileFilter) {
if (!file.isDirectory()) {
return null;
}
File[] files = file.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return fileFilter.accept(new LocalCarbonFile(pathname));
}
});
if (files == null) {
return new CarbonFile[0];
}
CarbonFile[] carbonFiles = new CarbonFile[files.length];
for (int i = 0; i < carbonFiles.length; i++) {
carbonFiles[i] = new LocalCarbonFile(files[i]);
}
return carbonFiles;
}
Aggregations