FolderEntry extends VirtualFileEntry { public VirtualFileEntry getChild(String path) throws ForbiddenException, ServerException { final VirtualFile child = getVirtualFile().getChild(path); if (child == null) { return null; } if (child.isFile()) { return new FileEntry(getWorkspace(), child); } return new FolderEntry(getWorkspace(), child); } FolderEntry(String workspace, VirtualFile virtualFile); @Override FolderEntry copyTo(String newParent); @Override FolderEntry copyTo(String newParent, String name, boolean overWrite); VirtualFileEntry getChild(String path); List<VirtualFileEntry> getChildren(); List<FileEntry> getChildFiles(); List<FolderEntry> getChildFolders(); List<VirtualFileEntry> getChildFoldersFiles(); FileEntry createFile(String name, byte[] content, String mediaType); FileEntry createFile(String name, InputStream content, String mediaType); FolderEntry createFolder(String name); boolean isProjectFolder(); boolean isRoot();  }
@Test public void testRename() throws Exception { String name = myFolder.getName(); String newName = name + "_renamed"; String newPath = myVfProject.getVirtualFilePath().newPath(newName).toString(); myFolder.rename(newName); Assert.assertNull(myVfProject.getChild(name)); Assert.assertNotNull(myVfProject.getChild(newName)); Assert.assertEquals(myFolder.getName(), newName); Assert.assertEquals(myFolder.getPath(), newPath); Assert.assertNotNull(myFolder.getChild("child_file")); Assert.assertNotNull(myFolder.getChild("child_folder")); }
@Test public void testRemove() throws Exception { String name = myFolder.getName(); myFolder.remove(); Assert.assertFalse(myVfFolder.exists()); Assert.assertNull(myVfProject.getChild(name)); }