public static class NacFile.Tree extends NacTreeNode<java.lang.String>
Constructor and Description |
---|
Tree(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String name) |
void |
add(java.lang.String name,
long id)
Add a file/folder to the given directory in the NacTree structure.
|
void |
addToDirectory(java.lang.String toDirectory,
java.lang.String name) |
void |
addToDirectory(java.lang.String toDirectory,
java.lang.String name,
long id)
Add a file/directory to the given directory in the NacTree structure.
|
void |
cd(NacTreeNode<java.lang.String> dir)
Change directory to the given NacTree node.
|
void |
cd(java.lang.String path) |
NacTreeNode<java.lang.String> |
getDirectory() |
java.lang.String |
getDirectoryPath() |
java.lang.String |
getHome() |
java.lang.String |
getPath(NacTreeNode<java.lang.String> node) |
java.util.List<NacFile.Metadata> |
ls() |
java.util.List<NacFile.Metadata> |
ls(java.lang.String path)
List the contents of the given path.
|
java.util.List<NacFile.Metadata> |
lsSort() |
java.util.List<NacFile.Metadata> |
lsSort(java.lang.String path)
List the contents of the given path and sort the output.
|
void |
print()
Print the contents of the current directory.
|
void |
setDirectory(NacTreeNode<java.lang.String> dir)
Set the current directory.
|
java.lang.String |
strip(java.lang.String path)
Strip the home directory away from a path.
|
public void add(java.lang.String name)
add(String, long)
public void add(java.lang.String name, long id)
name
- The name of the file or directory to add.id
- The content ID, used to create the content Uri.public void addToDirectory(java.lang.String toDirectory, java.lang.String name)
addToDirectory(String, String, long)
public void addToDirectory(java.lang.String toDirectory, java.lang.String name, long id)
toDirectory
- The name of the directory to add to.name
- The name of the file or directory to add.id
- The content ID, used to create the content Uri.public void cd(java.lang.String path)
cd(NacTreeNode)
public void cd(NacTreeNode<java.lang.String> dir)
public NacTreeNode<java.lang.String> getDirectory()
public java.lang.String getDirectoryPath()
public java.lang.String getHome()
public java.lang.String getPath(NacTreeNode<java.lang.String> node)
public java.util.List<NacFile.Metadata> ls()
ls(String)
public java.util.List<NacFile.Metadata> ls(java.lang.String path)
path
- The path to list the contents of.public java.util.List<NacFile.Metadata> lsSort()
lsSort(String)
public java.util.List<NacFile.Metadata> lsSort(java.lang.String path)
path
- The path to list the contents of.public void print()
public java.lang.String strip(java.lang.String path)
public void setDirectory(NacTreeNode<java.lang.String> dir)