Hi mario
thanks for the trick. I'll use it but I think
FileObject[] getChildren(FileSelector selector) throws FileSystemException
should be added. In java.io.File you can find listFiles(FileFilter filter). I think VFS should have most of the java.io.File features plus the advantage of a single api for multiple providers.
Thanks again Edgar
Mario Ivankovits wrote:
Edgar Poce wrote:
Hi
I want to list only the folder children and I don't find this method in FileObject class.
FileObject[] getChildren(FileTypeSelector selector) throws FileSystemException
final FileObject fo = VFS.getManager().resolveFile("/your/parent/directory");
FileObject[] children = fo.findFiles(new FileTypeSelector(FileType.FOLDER)
{
public boolean includeFile(FileSelectInfo fileSelectInfo) throws FileSystemException
{
if (fileSelectInfo.getFile() == fo)
{
return false;
}
return super.includeFile(fileSelectInfo);
}
public boolean traverseDescendents(FileSelectInfo fileSelectInfo)
{
return fileSelectInfo.getFile() == fo;
}
});
Should do the trick.
For sure - it would be best if you pack the above into your own FileSelector.
--- Mario
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
