public class InodeFolder extends Inode
Constructor and Description |
---|
InodeFolder(String name,
int id,
int parentId,
long creationTimeMs) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Inode child)
Adds the given inode to the set of children.
|
void |
addChildren(Inode[] children)
Adds the given inodes to the set of children.
|
ClientFileInfo |
generateClientFileInfo(String path)
Generates client file info for the folder.
|
Inode |
getChild(int fid)
Returns the child with the given id.
|
Inode |
getChild(String name)
Returns the child with the given name.
|
Set<Inode> |
getChildren()
Returns the folder's children.
|
List<Integer> |
getChildrenIds()
Returns the ids of the children.
|
int |
getNumberOfChildren()
Returns the number of children the folder has.
|
boolean |
removeChild(Inode child)
Removes the given inode from the folder.
|
boolean |
removeChild(String name)
Removes the given child from the folder.
|
String |
toString() |
void |
writeImage(com.fasterxml.jackson.databind.ObjectWriter objWriter,
DataOutputStream dos)
Write an image of the folder.
|
compareTo, equals, getCreationTimeMs, getId, getName, getParentId, hashCode, isDirectory, isFile, isPinned, reverseId, setName, setParentId, setPinned
writeElement
public InodeFolder(String name, int id, int parentId, long creationTimeMs)
public void addChild(Inode child)
child
- The inode to addpublic void addChildren(Inode[] children)
children
- The inodes to addpublic ClientFileInfo generateClientFileInfo(String path)
generateClientFileInfo
in class Inode
path
- The path of the folder in the filesystempublic Inode getChild(int fid)
fid
- The id of the childpublic Inode getChild(String name)
name
- The name of the childpublic Set<Inode> getChildren()
public List<Integer> getChildrenIds()
public int getNumberOfChildren()
public boolean removeChild(Inode child)
child
- The Inode to removepublic boolean removeChild(String name)
name
- The name of the Inode to remove.public void writeImage(com.fasterxml.jackson.databind.ObjectWriter objWriter, DataOutputStream dos) throws IOException
os
- The output stream to write the folder toIOException
Copyright © 2014. All rights reserved.