Package org.opencms.repository
Interface I_CmsRepositorySession
- All Known Implementing Classes:
A_CmsRepositorySession
,CmsRepositorySession
public interface I_CmsRepositorySession
A repository session which provides basic file and folder operations
to the resources in the VFS of OpenCms.
- Since:
- 6.2.4
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Copies the item found at the source path to the destination path.void
Creates a new item at the given path.void
Deletes the item at the given path.boolean
Returns if an item exists at the given path.Returns the item found at the given path.Returns the lock for the resource at the given path.getProperties
(String path) Gets the properties for the given path.Returns a list with all items found directly in the given path.boolean
lock
(String path, CmsRepositoryLockInfo lock) Creates a new lock on the item at the path with the given information in the lock info.void
Moves an item from a source path to a destination path.void
save
(String path, InputStream inputStream, boolean overwrite) Saves an item at the given path.void
Unlocks the item found at the path.void
updateProperties
(String path, Map<CmsPropertyName, String> properties) Updates the properties for the given path.
-
Method Details
-
copy
Copies the item found at the source path to the destination path.- Parameters:
src
- the path of the item which should be copieddest
- the destination path where to copy tooverwrite
- should any existing item be overwrittenshallow
- if true, when copying a folder, only the folder will be copied and not its contents- Throws:
CmsException
- if something goes wrong
-
create
Creates a new item at the given path.In this case this should be a collection (directory).
- Parameters:
path
- the complete path of the new collection- Throws:
CmsException
- if something goes wrong
-
delete
Deletes the item at the given path.- Parameters:
path
- the complete path of the item to delete- Throws:
CmsException
- if something goes wrong
-
exists
Returns if an item exists at the given path.- Parameters:
path
- the complete path of the item to check existance- Returns:
- true if the item exists otherwise false
-
getItem
Returns the item found at the given path.- Parameters:
path
- the complete path of the item to return- Returns:
- the item found at the path
- Throws:
CmsException
- if something goes wrong
-
getLock
Returns the lock for the resource at the given path.- Parameters:
path
- the complete path where to return the lock for- Returns:
- the found lock as CmsWebdavLockInfo or null if not found
-
getProperties
Gets the properties for the given path.- Parameters:
path
- the path- Returns:
- the properties for the path
- Throws:
CmsException
- if something goes wrong
-
list
Returns a list with all items found directly in the given path.- Parameters:
path
- the complete path from which to return the items- Returns:
- a list with
I_CmsRepositoryItem
found in the path - Throws:
CmsException
- if something goes wrong
-
lock
Creates a new lock on the item at the path with the given information in the lock info.- Parameters:
path
- the complete path of the itemlock
- the information about the lock to create- Returns:
- if the lock was successfully
- Throws:
CmsException
- if something goes wrong
-
move
Moves an item from a source path to a destination path.- Parameters:
src
- the complete path to the item which should be copieddest
- the complete destination path where to copy tooverwrite
- should any existing item should be overwritten- Throws:
CmsException
- if something goes wrong
-
save
Saves an item at the given path.This creates a new single item (file) if it does not exist.
- Parameters:
path
- the complete path of the new iteminputStream
- the content of the itemoverwrite
- should an existing item at the path be overwritten- Throws:
CmsException
- if something goes wrongIOException
- if a write error occurs
-
unlock
Unlocks the item found at the path.- Parameters:
path
- The complete path of the item to unlock
-
updateProperties
Updates the properties for the given path.- Parameters:
path
- the pathproperties
- the properties- Throws:
CmsException
- if something goes wrong
-