Methods Summary |
---|
public java.lang.String[] | getFiles()
getFilesInternal(mainRoot);
String[] files = new String[fileList.size()];
if(files.length <= 0)
return files;
int len = 0;
if(relativePath())
len = mainRoot.getPath().length() + 1;
for(int i = 0; i < files.length; i++)
{
files[i] = ((File)fileList.get(i)).getPath().substring(len).replace('\\", '/");
}
Arrays.sort(files, String.CASE_INSENSITIVE_ORDER);
return files;
|
private void | getFilesInternal(java.io.File root)
File[] files = root.listFiles();
for(int i = 0; i < files.length; i++)
{
if(files[i].isDirectory())
{
getFilesInternal(files[i]);
}
else
fileList.add(files[i]); // actual file
}
// add empty directory, if the option is turned on
if(files.length <= 0 && keepEmpty)
fileList.add(root);
|
public void | keepEmptyDirectories()Normally, we don't want a list of empty (leaf) directories. In case this
is desired -- call this method. The default is to NOT keep empty directories
in the list
keepEmpty = true;
|
protected abstract boolean | relativePath()
|