* Tests that children cannot be listed for non-folders.
*/
public void testChildren() throws FileSystemException
{
// Check for file
FileObject file = getReadFolder().resolveFile("file1.txt");
assertSame(FileType.FILE, file.getType());
try
{
file.getChildren();
fail();
}
catch (FileSystemException e)
{
assertSameMessage("vfs.provider/list-children-not-folder.error", file, e);
}
// Should be able to get child by name
file = file.resolveFile("some-child");
assertNotNull(file);
// Check for unknown file
file = getReadFolder().resolveFile("unknown-file");
assertTrue(!file.exists());
try
{
file.getChildren();
fail();
}
catch (final FileSystemException e)
{
assertSameMessage("vfs.provider/list-children-not-folder.error", file, e);
}
// Should be able to get child by name
FileObject child = file.resolveFile("some-child");
assertNotNull(child);
}