public class JCRFolder extends Object implements ModifiableFolder
Text.escapeIllegalJcrChars(String)
is used for
escaping invalid JCR characters or character sequences.
Modifier and Type | Field and Description |
---|---|
private boolean |
_lockAlreadyChecked |
private Node |
_node |
Modifier and Type | Method and Description |
---|---|
private void |
_checkLock() |
ModifiableFile |
addFile(String fileName)
Add a file with the specified name in this folder.
|
ModifiableFolder |
addFolder(String folderName)
Add a folder with the specified name in this folder.
|
ModifiableFile |
getFile(String fileName)
Returns the file with the specified name.
|
Collection<ModifiableFile> |
getFiles()
Returns a Collection containing all files of this folder.
|
ModifiableFolder |
getFolder(String folderName)
Returns the folder with the specified name.
|
Collection<ModifiableFolder> |
getFolders()
Returns a Collection containing all subfolders of this folder.
|
String |
getName()
Returns the folder name.
|
Node |
getNode()
Retrieves the underlying node.
|
boolean |
hasFile(String fileName)
Tests the existence of a file.
|
void |
remove(String name)
Removes the sub-element represented by the specified name.
|
void |
removeAll()
Removes all files and folders in this folder.
|
private boolean _lockAlreadyChecked
public String getName() throws AmetysRepositoryException
Folder
getName
in interface Folder
AmetysRepositoryException
- if an error occurs.public Collection<ModifiableFolder> getFolders()
Folder
getFolders
in interface Folder
getFolders
in interface ModifiableFolder
public ModifiableFolder getFolder(String folderName)
Folder
getFolder
in interface Folder
getFolder
in interface ModifiableFolder
folderName
- the name of the folder.public ModifiableFolder addFolder(String folderName)
ModifiableFolder
addFolder
in interface ModifiableFolder
folderName
- the folder name.public Collection<ModifiableFile> getFiles()
Folder
getFiles
in interface Folder
getFiles
in interface ModifiableFolder
public boolean hasFile(String fileName) throws AmetysRepositoryException
Folder
hasFile
in interface Folder
fileName
- the name of the file.AmetysRepositoryException
- if an error occurs.public ModifiableFile getFile(String fileName)
Folder
getFile
in interface Folder
getFile
in interface ModifiableFolder
fileName
- the name of the file.public ModifiableFile addFile(String fileName)
ModifiableFolder
addFile
in interface ModifiableFolder
fileName
- the file name.public void remove(String name) throws AmetysRepositoryException
ModifiableFolder
remove
in interface ModifiableFolder
name
- the name of the folder or file to be removed.UnknownMetadataException
- if no folder nor file does exists.AmetysRepositoryException
- if an error occurs.public void removeAll() throws AmetysRepositoryException
ModifiableFolder
removeAll
in interface ModifiableFolder
AmetysRepositoryException
- if an error occurs.private void _checkLock() throws RepositoryException
RepositoryException