Package org.pentaho.di.repository
Class RepositoryDirectory
java.lang.Object
org.pentaho.di.repository.RepositoryDirectory
- All Implemented Interfaces:
RepositoryDirectoryInterface,RepositoryObjectInterface
This class defines the location of a transformation, job or schema in the repository. That means that it's just an
extra parameter for recognizing a transformation, job or schema. It allows for sub-directories by linking back to
itself.
TODO: This class is referenced in a large amount of Interfaces. We should convert it into an interface.
- Since:
- 09-nov-2004
- Author:
- Matt
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty repository directory.RepositoryDirectory(RepositoryDirectoryInterface parent, String directoryname) Create a new sub-directory in a certain other directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a subdirectory to this directory.voidclear()findDirectory(String path) Find a directory using the path to the directory with file.separator between the dir-names.findDirectory(String[] path) Find the directory by following the path of stringsfindDirectory(ObjectId id_directory) Find the sub-directory with a certain IDfindRoot()Find the root of the directory tree starting from this directory.Returns a list of child directoriesObjectId[]Get all the directory-id in this directory and the subdirectories.getName()Get the name of this directory...intCounts the number of subdirectories in this directory.Get the database ID in the repository for this object.get the parent directory for this directory.getPath()Describe the complete path to ( and including) this directory, separated by the RepositoryDirectory.DIRECTORY_SEPARATOR property (slash).String[]Describe the complete path to ( and including) this directory, as an array of strings.getPathObjectCombination(String transName) Returns a list of child filesgetSubdirectory(int i) Get a subdirectory on a certain position.getXML()Return the description of this directory & the subdirectories in XML.getXML(int level) booleanisRoot()Check whether or not this is the root of the directory trees.booleanIf true, this directory should be shown in UIs.booleanLoad the directory & subdirectories from XMLvoidsetChildren(List<RepositoryDirectoryInterface> children) sets the list of child directoriesvoidSet the directory name (rename)voidsetObjectId(ObjectId id) Set the database ID for this object in the repository.voidChange the parent of this directory.voidsetRepositoryObjects(List<RepositoryElementMetaInterface> repositoryObjects) sets the list of child filesvoidsetVisible(boolean visible) toString()
-
Field Details
-
DIRECTORY_SEPARATOR
- See Also:
-
-
Constructor Details
-
RepositoryDirectory
Create a new sub-directory in a certain other directory.- Parameters:
parent- The directory to create the sub-directory indirectoryname- The name of the new directory.
-
RepositoryDirectory
public RepositoryDirectory()Create an empty repository directory. With the name and parent set to empty, this is the root directory.
-
-
Method Details
-
getChildren
Description copied from interface:RepositoryDirectoryInterfaceReturns a list of child directories- Specified by:
getChildrenin interfaceRepositoryDirectoryInterface- Returns:
- list of child directories
-
setChildren
Description copied from interface:RepositoryDirectoryInterfacesets the list of child directories- Specified by:
setChildrenin interfaceRepositoryDirectoryInterface- Parameters:
children- list of child directories
-
getRepositoryObjects
Description copied from interface:RepositoryDirectoryInterfaceReturns a list of child files- Specified by:
getRepositoryObjectsin interfaceRepositoryDirectoryInterface- Returns:
- list of child files
-
setRepositoryObjects
Description copied from interface:RepositoryDirectoryInterfacesets the list of child files- Specified by:
setRepositoryObjectsin interfaceRepositoryDirectoryInterface- Parameters:
repositoryObjects- list of child files
-
clear
public void clear()- Specified by:
clearin interfaceRepositoryDirectoryInterface
-
getObjectId
Get the database ID in the repository for this object.- Specified by:
getObjectIdin interfaceRepositoryObjectInterface- Returns:
- the database ID in the repository for this object.
-
setObjectId
Set the database ID for this object in the repository.- Specified by:
setObjectIdin interfaceRepositoryDirectoryInterface- Parameters:
id- the database ID for this object in the repository.
-
setParent
Change the parent of this directory. (move directory)- Specified by:
setParentin interfaceRepositoryDirectoryInterface- Parameters:
parent- The new parent of this directory.
-
getParent
get the parent directory for this directory.- Specified by:
getParentin interfaceRepositoryDirectoryInterface- Returns:
- The parent directory of null if this is the root directory.
-
setName
Set the directory name (rename)- Specified by:
setNamein interfaceRepositoryDirectoryInterface- Parameters:
directoryname- The new directory name
-
getName
Get the name of this directory...- Specified by:
getNamein interfaceRepositoryObjectInterface- Returns:
- the name of this directory
-
isRoot
public boolean isRoot()Check whether or not this is the root of the directory trees. (default)- Specified by:
isRootin interfaceRepositoryDirectoryInterface- Returns:
- true if this is the root directory node. False if it is not.
-
getPath
Describe the complete path to ( and including) this directory, separated by the RepositoryDirectory.DIRECTORY_SEPARATOR property (slash).- Specified by:
getPathin interfaceRepositoryDirectoryInterface- Returns:
- The complete path to this directory.
-
getPathArray
Describe the complete path to ( and including) this directory, as an array of strings.- Specified by:
getPathArrayin interfaceRepositoryDirectoryInterface- Returns:
- The complete path to this directory.
-
addSubdirectory
Add a subdirectory to this directory.- Specified by:
addSubdirectoryin interfaceRepositoryDirectoryInterface- Parameters:
subdir- The subdirectory to add.
-
getNrSubdirectories
public int getNrSubdirectories()Counts the number of subdirectories in this directory.- Specified by:
getNrSubdirectoriesin interfaceRepositoryDirectoryInterface- Returns:
- The number of subdirectories
-
getSubdirectory
Get a subdirectory on a certain position.- Specified by:
getSubdirectoryin interfaceRepositoryDirectoryInterface- Parameters:
i- The subdirectory position- Returns:
- The subdirectory with on a certain position
-
findDirectory
Find the directory by following the path of strings- Specified by:
findDirectoryin interfaceRepositoryDirectoryInterface- Parameters:
path- The path to the directory we're looking for.- Returns:
- The directory if one can be found, null if no directory was found.
-
findDirectory
Find a directory using the path to the directory with file.separator between the dir-names.- Specified by:
findDirectoryin interfaceRepositoryDirectoryInterface- Parameters:
path- The path to the directory- Returns:
- The directory if one was found, null if nothing was found.
-
findChild
- Specified by:
findChildin interfaceRepositoryDirectoryInterface
-
findDirectory
Find the sub-directory with a certain ID- Specified by:
findDirectoryin interfaceRepositoryDirectoryInterface- Parameters:
id_directory- the directory ID to look for.- Returns:
- The RepositoryDirectory if the ID was found, null if nothing could be found.
-
getXML
Return the description of this directory & the subdirectories in XML.- Returns:
- The XML describing this directory.
-
getXML
-
loadXML
Load the directory & subdirectories from XML- Parameters:
repdirnode- The node in which the Repository directory information resides.- Returns:
- True if all went well, false if an error occured.
-
getDirectoryIDs
Get all the directory-id in this directory and the subdirectories.- Specified by:
getDirectoryIDsin interfaceRepositoryDirectoryInterface- Returns:
- an array of all the directory id's (this directory & subdirectories)
-
findRoot
Find the root of the directory tree starting from this directory.- Specified by:
findRootin interfaceRepositoryDirectoryInterface- Returns:
- the root of the directory tree
-
toString
-
getPathObjectCombination
- Specified by:
getPathObjectCombinationin interfaceRepositoryDirectoryInterface
-
isVisible
public boolean isVisible()Description copied from interface:RepositoryDirectoryInterfaceIf true, this directory should be shown in UIs. Not necessarily persisted. Each repository implementation decides whether to mark each directory as visible.- Specified by:
isVisiblein interfaceRepositoryDirectoryInterface
-
setVisible
public void setVisible(boolean visible)
-