FolderPathElementpublic class FolderPathElement extends Object implements ClassPathElement
Fields Summary |
---|
private File | baseFolder |
Constructors Summary |
---|
public FolderPathElement(File baseFolder)
this.baseFolder = baseFolder;
|
Methods Summary |
---|
public void | close()
| private void | collect(java.io.File folder, java.lang.String prefix, java.util.ArrayList result)
for (File file : folder.listFiles()) {
if (file.isDirectory()) {
collect(file, prefix + SEPARATOR_CHAR + file.getName(), result);
} else {
result.add(prefix + SEPARATOR_CHAR + file.getName());
}
}
| public java.lang.Iterable | list()
ArrayList<String> result = new ArrayList<String>();
collect(baseFolder, "", result);
return result;
| public java.io.InputStream | open(java.lang.String path)
return new FileInputStream(new File(baseFolder,
path.replace(SEPARATOR_CHAR, File.separatorChar)));
|
|