public class RepositoryDirectory extends Object implements RepositoryDirectoryInterface
Modifier and Type | Field and Description |
---|---|
static String |
DIRECTORY_SEPARATOR |
Constructor and Description |
---|
RepositoryDirectory()
Create an empty repository directory.
|
RepositoryDirectory(RepositoryDirectoryInterface parent,
String directoryname)
Create a new sub-directory in a certain other directory.
|
Modifier and Type | Method and Description |
---|---|
void |
addSubdirectory(RepositoryDirectoryInterface subdir)
Add a subdirectory to this directory.
|
void |
clear() |
RepositoryDirectory |
findChild(String name) |
RepositoryDirectory |
findDirectory(ObjectId id_directory)
Find the sub-directory with a certain ID
|
RepositoryDirectory |
findDirectory(String path)
Find a directory using the path to the directory with file.separator between the dir-names.
|
RepositoryDirectory |
findDirectory(String[] path)
Find the directory by following the path of strings
|
RepositoryDirectoryInterface |
findRoot()
Find the root of the directory tree starting from this directory.
|
List<RepositoryDirectoryInterface> |
getChildren()
Returns a list of child directories
|
ObjectId[] |
getDirectoryIDs()
Get all the directory-id in this directory and the subdirectories.
|
String |
getName()
Get the name of this directory...
|
int |
getNrSubdirectories()
Counts the number of subdirectories in this directory.
|
ObjectId |
getObjectId()
Get the database ID in the repository for this object.
|
RepositoryDirectoryInterface |
getParent()
get the parent directory for this directory.
|
String |
getPath()
Describe the complete path to ( and including) this directory, separated by the
RepositoryDirectory.DIRECTORY_SEPARATOR property (slash).
|
String[] |
getPathArray()
Describe the complete path to ( and including) this directory, as an array of strings.
|
String |
getPathObjectCombination(String transName) |
List<RepositoryElementMetaInterface> |
getRepositoryObjects()
Returns a list of child files
|
RepositoryDirectory |
getSubdirectory(int i)
Get a subdirectory on a certain position.
|
String |
getXML()
Return the description of this directory & the subdirectories in XML.
|
String |
getXML(int level) |
boolean |
isRoot()
Check whether or not this is the root of the directory trees.
|
boolean |
isVisible()
If true, this directory should be shown in UIs.
|
boolean |
loadXML(Node repdirnode)
Load the directory & subdirectories from XML
|
void |
setChildren(List<RepositoryDirectoryInterface> children)
sets the list of child directories
|
void |
setName(String directoryname)
Set the directory name (rename)
|
void |
setObjectId(ObjectId id)
Set the database ID for this object in the repository.
|
void |
setParent(RepositoryDirectoryInterface parent)
Change the parent of this directory.
|
void |
setRepositoryObjects(List<RepositoryElementMetaInterface> repositoryObjects)
sets the list of child files
|
void |
setVisible(boolean visible) |
String |
toString() |
public static final String DIRECTORY_SEPARATOR
public RepositoryDirectory(RepositoryDirectoryInterface parent, String directoryname)
parent
- The directory to create the sub-directory indirectoryname
- The name of the new directory.public RepositoryDirectory()
public List<RepositoryDirectoryInterface> getChildren()
RepositoryDirectoryInterface
getChildren
in interface RepositoryDirectoryInterface
public void setChildren(List<RepositoryDirectoryInterface> children)
RepositoryDirectoryInterface
setChildren
in interface RepositoryDirectoryInterface
children
- list of child directoriespublic List<RepositoryElementMetaInterface> getRepositoryObjects()
RepositoryDirectoryInterface
getRepositoryObjects
in interface RepositoryDirectoryInterface
public void setRepositoryObjects(List<RepositoryElementMetaInterface> repositoryObjects)
RepositoryDirectoryInterface
setRepositoryObjects
in interface RepositoryDirectoryInterface
repositoryObjects
- list of child filespublic void clear()
clear
in interface RepositoryDirectoryInterface
public ObjectId getObjectId()
getObjectId
in interface RepositoryObjectInterface
public void setObjectId(ObjectId id)
setObjectId
in interface RepositoryDirectoryInterface
id
- the database ID for this object in the repository.public void setParent(RepositoryDirectoryInterface parent)
setParent
in interface RepositoryDirectoryInterface
parent
- The new parent of this directory.public RepositoryDirectoryInterface getParent()
getParent
in interface RepositoryDirectoryInterface
public void setName(String directoryname)
setName
in interface RepositoryDirectoryInterface
directoryname
- The new directory namepublic String getName()
getName
in interface RepositoryObjectInterface
public boolean isRoot()
isRoot
in interface RepositoryDirectoryInterface
public String getPath()
getPath
in interface RepositoryDirectoryInterface
public String[] getPathArray()
getPathArray
in interface RepositoryDirectoryInterface
public void addSubdirectory(RepositoryDirectoryInterface subdir)
addSubdirectory
in interface RepositoryDirectoryInterface
subdir
- The subdirectory to add.public int getNrSubdirectories()
getNrSubdirectories
in interface RepositoryDirectoryInterface
public RepositoryDirectory getSubdirectory(int i)
getSubdirectory
in interface RepositoryDirectoryInterface
i
- The subdirectory positionpublic RepositoryDirectory findDirectory(String[] path)
findDirectory
in interface RepositoryDirectoryInterface
path
- The path to the directory we're looking for.public RepositoryDirectory findDirectory(String path)
findDirectory
in interface RepositoryDirectoryInterface
path
- The path to the directorypublic RepositoryDirectory findChild(String name)
findChild
in interface RepositoryDirectoryInterface
public RepositoryDirectory findDirectory(ObjectId id_directory)
findDirectory
in interface RepositoryDirectoryInterface
id_directory
- the directory ID to look for.public String getXML()
public String getXML(int level)
public boolean loadXML(Node repdirnode)
repdirnode
- The node in which the Repository directory information resides.public ObjectId[] getDirectoryIDs()
getDirectoryIDs
in interface RepositoryDirectoryInterface
public RepositoryDirectoryInterface findRoot()
findRoot
in interface RepositoryDirectoryInterface
public String getPathObjectCombination(String transName)
getPathObjectCombination
in interface RepositoryDirectoryInterface
public boolean isVisible()
RepositoryDirectoryInterface
isVisible
in interface RepositoryDirectoryInterface
public void setVisible(boolean visible)