|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.repository.A_CmsRepositorySession
org.opencms.repository.CmsRepositorySession
public class CmsRepositorySession
This is the session class to work with the CmsRepository
.
You can get an instance of this class by calling
CmsRepository.login(String, String)
.
This class provides basic file and folder operations on the resources in the VFS of OpenCms.
A_CmsRepositorySession
,
I_CmsRepositorySession
Constructor Summary | |
---|---|
CmsRepositorySession(CmsObjectWrapper cms,
CmsRepositoryFilter filter)
Constructor with an initialized CmsObjectWrapper and a
CmsRepositoryFilter to use. |
Method Summary | |
---|---|
void |
copy(java.lang.String src,
java.lang.String dest,
boolean overwrite)
Copies the item found at the source path to the destination path. |
void |
create(java.lang.String path)
Creates a new item at the given path. |
void |
delete(java.lang.String path)
Deletes the item at the given path. |
boolean |
exists(java.lang.String path)
Returns if an item exists at the given path. |
I_CmsRepositoryItem |
getItem(java.lang.String path)
Returns the item found at the given path. |
CmsRepositoryLockInfo |
getLock(java.lang.String path)
Returns the lock for the resource at the given path. |
protected boolean |
isFiltered(java.lang.String name)
Adds the site root to the path name and checks then if the path is filtered. |
java.util.List |
list(java.lang.String path)
Returns a list with all items found directly in the given path. |
boolean |
lock(java.lang.String path,
CmsRepositoryLockInfo lock)
Creates a new lock on the item at the path with the given information in the lock info. |
void |
move(java.lang.String src,
java.lang.String dest,
boolean overwrite)
Moves an item from a source path to a destination path. |
void |
save(java.lang.String path,
java.io.InputStream inputStream,
boolean overwrite)
Saves an item at the given path. |
void |
unlock(java.lang.String path)
Unlocks the item found at the path. |
Methods inherited from class org.opencms.repository.A_CmsRepositorySession |
---|
getFilter, setFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsRepositorySession(CmsObjectWrapper cms, CmsRepositoryFilter filter)
CmsObjectWrapper
and a
CmsRepositoryFilter
to use.
cms
- the initialized CmsObjectfilter
- the repository filter to useMethod Detail |
---|
public void copy(java.lang.String src, java.lang.String dest, boolean overwrite) throws CmsException
I_CmsRepositorySession
src
- the path of the item which should be copieddest
- the destination path where to copy tooverwrite
- should any existing item be overwritten
CmsException
- if something goes wrongI_CmsRepositorySession.copy(java.lang.String, java.lang.String, boolean)
public void create(java.lang.String path) throws CmsException
I_CmsRepositorySession
In this case this should be a collection (directory).
path
- the complete path of the new collection
CmsException
- if something goes wrongI_CmsRepositorySession.create(java.lang.String)
public void delete(java.lang.String path) throws CmsException
I_CmsRepositorySession
path
- the complete path of the item to delete
CmsException
- if something goes wrongI_CmsRepositorySession.delete(java.lang.String)
public boolean exists(java.lang.String path)
I_CmsRepositorySession
path
- the complete path of the item to check existance
I_CmsRepositorySession.exists(java.lang.String)
public I_CmsRepositoryItem getItem(java.lang.String path) throws CmsException
I_CmsRepositorySession
path
- the complete path of the item to return
CmsException
- if something goes wrongI_CmsRepositorySession.getItem(java.lang.String)
public CmsRepositoryLockInfo getLock(java.lang.String path)
I_CmsRepositorySession
path
- the complete path where to return the lock for
I_CmsRepositorySession.getLock(java.lang.String)
public java.util.List list(java.lang.String path) throws CmsException
I_CmsRepositorySession
path
- the complete path from which to return the items
I_CmsRepositoryItem
found in the path
CmsException
- if something goes wrongI_CmsRepositorySession.list(java.lang.String)
public boolean lock(java.lang.String path, CmsRepositoryLockInfo lock) throws CmsException
I_CmsRepositorySession
path
- the complete path of the itemlock
- the information about the lock to create
CmsException
- if something goes wrongI_CmsRepositorySession.lock(java.lang.String, org.opencms.repository.CmsRepositoryLockInfo)
public void move(java.lang.String src, java.lang.String dest, boolean overwrite) throws CmsException
I_CmsRepositorySession
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
CmsException
- if something goes wrongI_CmsRepositorySession.move(java.lang.String, java.lang.String, boolean)
public void save(java.lang.String path, java.io.InputStream inputStream, boolean overwrite) throws CmsException, java.io.IOException
I_CmsRepositorySession
This creates a new single item (file) if it does not exist.
path
- the complete path of the new iteminputStream
- the content of the itemoverwrite
- should an existing item at the path be overwritten
CmsException
- if something goes wrong
java.io.IOException
- if a write error occursI_CmsRepositorySession.save(java.lang.String, java.io.InputStream, boolean)
public void unlock(java.lang.String path)
I_CmsRepositorySession
path
- The complete path of the item to unlockI_CmsRepositorySession.unlock(java.lang.String)
protected boolean isFiltered(java.lang.String name)
isFiltered
in class A_CmsRepositorySession
name
- the path of a resource to check
A_CmsRepositorySession.isFiltered(java.lang.String)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |