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
-
Constructor Summary
ConstructorDescriptionCreate an empty repository directory.RepositoryDirectory
(RepositoryDirectoryInterface parent, String directoryname) Create a new sub-directory in a certain other directory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a subdirectory to this directory.void
clear()
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...int
Counts 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) boolean
isRoot()
Check whether or not this is the root of the directory trees.boolean
If true, this directory should be shown in UIs.boolean
Load the directory & subdirectories from XMLvoid
setChildren
(List<RepositoryDirectoryInterface> children) sets the list of child directoriesvoid
Set the directory name (rename)void
setObjectId
(ObjectId id) Set the database ID for this object in the repository.void
Change the parent of this directory.void
setRepositoryObjects
(List<RepositoryElementMetaInterface> repositoryObjects) sets the list of child filesvoid
setVisible
(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:RepositoryDirectoryInterface
Returns a list of child directories- Specified by:
getChildren
in interfaceRepositoryDirectoryInterface
- Returns:
- list of child directories
-
setChildren
Description copied from interface:RepositoryDirectoryInterface
sets the list of child directories- Specified by:
setChildren
in interfaceRepositoryDirectoryInterface
- Parameters:
children
- list of child directories
-
getRepositoryObjects
Description copied from interface:RepositoryDirectoryInterface
Returns a list of child files- Specified by:
getRepositoryObjects
in interfaceRepositoryDirectoryInterface
- Returns:
- list of child files
-
setRepositoryObjects
Description copied from interface:RepositoryDirectoryInterface
sets the list of child files- Specified by:
setRepositoryObjects
in interfaceRepositoryDirectoryInterface
- Parameters:
repositoryObjects
- list of child files
-
clear
public void clear()- Specified by:
clear
in interfaceRepositoryDirectoryInterface
-
getObjectId
Get the database ID in the repository for this object.- Specified by:
getObjectId
in interfaceRepositoryObjectInterface
- Returns:
- the database ID in the repository for this object.
-
setObjectId
Set the database ID for this object in the repository.- Specified by:
setObjectId
in interfaceRepositoryDirectoryInterface
- Parameters:
id
- the database ID for this object in the repository.
-
setParent
Change the parent of this directory. (move directory)- Specified by:
setParent
in interfaceRepositoryDirectoryInterface
- Parameters:
parent
- The new parent of this directory.
-
getParent
get the parent directory for this directory.- Specified by:
getParent
in interfaceRepositoryDirectoryInterface
- Returns:
- The parent directory of null if this is the root directory.
-
setName
Set the directory name (rename)- Specified by:
setName
in interfaceRepositoryDirectoryInterface
- Parameters:
directoryname
- The new directory name
-
getName
Get the name of this directory...- Specified by:
getName
in 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:
isRoot
in 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:
getPath
in 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:
getPathArray
in interfaceRepositoryDirectoryInterface
- Returns:
- The complete path to this directory.
-
addSubdirectory
Add a subdirectory to this directory.- Specified by:
addSubdirectory
in interfaceRepositoryDirectoryInterface
- Parameters:
subdir
- The subdirectory to add.
-
getNrSubdirectories
public int getNrSubdirectories()Counts the number of subdirectories in this directory.- Specified by:
getNrSubdirectories
in interfaceRepositoryDirectoryInterface
- Returns:
- The number of subdirectories
-
getSubdirectory
Get a subdirectory on a certain position.- Specified by:
getSubdirectory
in 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:
findDirectory
in 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:
findDirectory
in interfaceRepositoryDirectoryInterface
- Parameters:
path
- The path to the directory- Returns:
- The directory if one was found, null if nothing was found.
-
findChild
- Specified by:
findChild
in interfaceRepositoryDirectoryInterface
-
findDirectory
Find the sub-directory with a certain ID- Specified by:
findDirectory
in 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:
getDirectoryIDs
in 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:
findRoot
in interfaceRepositoryDirectoryInterface
- Returns:
- the root of the directory tree
-
toString
-
getPathObjectCombination
- Specified by:
getPathObjectCombination
in interfaceRepositoryDirectoryInterface
-
isVisible
public boolean isVisible()Description copied from interface:RepositoryDirectoryInterface
If true, this directory should be shown in UIs. Not necessarily persisted. Each repository implementation decides whether to mark each directory as visible.- Specified by:
isVisible
in interfaceRepositoryDirectoryInterface
-
setVisible
public void setVisible(boolean visible)
-