@Test public void addChildrenTest() { InodeFolder inodeFolder = new InodeFolder("testFolder1", 1, 0, System.currentTimeMillis()); InodeFile inodeFile1 = new InodeFile("testFile1", 2, 1, 1000, System.currentTimeMillis()); InodeFile inodeFile2 = new InodeFile("testFile2", 3, 1, 1000, System.currentTimeMillis()); inodeFolder.addChild(inodeFile1); inodeFolder.addChild(inodeFile2); Assert.assertEquals(2, (int) inodeFolder.getChildrenIds().get(0)); Assert.assertEquals(3, (int) inodeFolder.getChildrenIds().get(1)); }
public synchronized void addChildren(Inode[] children) { for (Inode child : children) { addChild(child); } }
InodeFolder extends Inode { public synchronized void addChildren(Inode[] children) { for (Inode child : children) { addChild(child); } } }
InodeFolder extends Inode { public synchronized void addChildren(Inode[] children) { for (Inode child : children) { addChild(child); } } InodeFolder(String name, int id, int parentId, long creationTimeMs); }
InodeFolder extends Inode { public synchronized void addChildren(Inode[] children) { for (Inode child : children) { addChild(child); } } InodeFolder(String name, int id, int parentId, long creationTimeMs); synchronized void addChild(Inode child); synchronized void addChildren(Inode[] children); @Override ClientFileInfo generateClientFileInfo(String path); synchronized Inode getChild(int fid); synchronized Inode getChild(String name); synchronized Set<Inode> getChildren(); synchronized List<Integer> getChildrenIds(); synchronized int getNumberOfChildren(); synchronized boolean removeChild(Inode child); synchronized boolean removeChild(String name); @Override String toString(); @Override void writeImage(ObjectWriter objWriter, DataOutputStream dos); }
InodeFolder extends Inode { public synchronized void addChildren(Inode[] children) { for (Inode child : children) { addChild(child); } } InodeFolder(String name, int id, int parentId, long creationTimeMs); synchronized void addChild(Inode child); synchronized void addChildren(Inode[] children); @Override ClientFileInfo generateClientFileInfo(String path); synchronized Inode getChild(int fid); synchronized Inode getChild(String name); synchronized Set<Inode> getChildren(); synchronized List<Integer> getChildrenIds(); synchronized int getNumberOfChildren(); synchronized boolean removeChild(Inode child); synchronized boolean removeChild(String name); @Override String toString(); @Override void writeImage(ObjectWriter objWriter, DataOutputStream dos);  }