public class SkinResourceDAO extends Object implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
protected FileHelper |
_fileHelper
The file helper
|
protected SkinLockManager |
_lockManager
The lock manager
|
protected SkinEditionHelper |
_skinHelper
The skin edition helper
|
protected SourceResolver |
_srcResolver
The source resolver
|
static String |
SKIN_EDITOR_TOOL_ID
Constant for skin editor tool id
|
Constructor and Description |
---|
SkinResourceDAO() |
Modifier and Type | Method and Description |
---|---|
Map |
addFolder(String skinName,
String parentRelPath,
String originalName,
boolean renameIfExists)
Create a folder
|
boolean |
checkSourceExists(String skinName,
String parentRelPath,
String fileName)
checks if the resource already exists in the parent
|
Map<String,Object> |
copySource(String skinName,
String srcPath,
String parentTargetPath)
Copy a file or directory
|
Map |
deleteFile(String skinName,
String relPath)
Delete a file or a directory
|
Map<String,Object> |
moveSource(String skinName,
String srcPath,
String targetPath)
Move a file or a directory
|
Map |
renameSource(String skinName,
String relPath,
String name)
Rename a file or a directory
|
Map<String,Object> |
save(String skinName,
String relPath,
String text)
Saves the text in file
|
void |
service(ServiceManager manager) |
public static final String SKIN_EDITOR_TOOL_ID
protected SkinLockManager _lockManager
protected SkinEditionHelper _skinHelper
protected FileHelper _fileHelper
protected SourceResolver _srcResolver
public SkinResourceDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> save(String skinName, String relPath, String text) throws IOException
skinName
- The name of the skin containing the resourcerelPath
- the relative path of file under the skin directorytext
- the file content to saveIOException
- If an error occurred while savingpublic boolean checkSourceExists(String skinName, String parentRelPath, String fileName) throws IOException
skinName
- The name of the skin containing the resourceparentRelPath
- The parent pathfileName
- the file name to checkIOException
- if something goes wrong while trying to retrieve a filepublic Map<String,Object> copySource(String skinName, String srcPath, String parentTargetPath) throws IOException
skinName
- the name of the current skinsrcPath
- the path of the source file or directoryparentTargetPath
- the new path for the source file or directoryIOException
- if something went wrong during the source copy processingpublic Map addFolder(String skinName, String parentRelPath, String originalName, boolean renameIfExists) throws IOException
skinName
- the name of the current skinparentRelPath
- the path of the parent containing the folderoriginalName
- the name of the new folderrenameIfExists
- if true, will generate a valid name if "originalName" already exists.IOException
- if an error occurs while manipulating filespublic Map deleteFile(String skinName, String relPath) throws IOException
skinName
- the name of the current skinrelPath
- the path of the file or directoryIOException
- if an error occurs while manipulating filespublic Map<String,Object> moveSource(String skinName, String srcPath, String targetPath) throws IOException
skinName
- the name of current skinsrcPath
- the path of the file or directorytargetPath
- the targeted pathIOException
- if something goes wrong during the source moving processpublic Map renameSource(String skinName, String relPath, String name) throws IOException
skinName
- the current skin namerelPath
- the path of the filename
- the new nameIOException
- if something goes wrong when renaming the source