Class LocalRepositoryDao
java.lang.Object
org.eclipse.dirigible.repository.local.LocalRepositoryDao
public class LocalRepositoryDao extends Object
The Local Repository Dao.
-
Constructor Summary
Constructors Constructor Description LocalRepositoryDao(FileSystemRepository repository)Instantiates a new local repository dao. -
Method Summary
Modifier and Type Method Description voidcheckInitialized()Check initialized.voidcopyFile(String path, String newPath)Copy file.voidcopyFolder(String path, String newPath)Copy folder.voidcreateFile(String path, byte[] content, boolean isBinary, String contentType)Creates the file.voidcreateFolder(String normalizePath)Creates the folder.booleandirectoryExists(String path)Check whether the directory exists.booleanfileExists(String path)Check whether the file exists.List<LocalObject>getChildrenByFolder(String path)Gets the children by folder.byte[]getFileContent(LocalFile localFile)Gets the file content.LocalObjectgetObjectByPath(String path)Gets the object by path.FileSystemRepositorygetRepository()Gets the repository.voidremoveFileByPath(String path)Removes the file by path.voidremoveFolderByPath(String path)Removes the folder by path.voidrenameFile(String path, String newPath)Rename file.voidrenameFolder(String path, String newPath)Rename folder.voidsetFileContent(LocalFile localFile, byte[] content)Sets the file content.
-
Constructor Details
-
LocalRepositoryDao
Instantiates a new local repository dao.- Parameters:
repository- the repository
-
-
Method Details
-
getRepository
Gets the repository.- Returns:
- the repository
-
createFile
public void createFile(String path, byte[] content, boolean isBinary, String contentType) throws LocalRepositoryExceptionCreates the file.- Parameters:
path- the pathcontent- the contentisBinary- the is binarycontentType- the content type- Throws:
LocalRepositoryException- the local repository exception
-
checkInitialized
public void checkInitialized()Check initialized. -
setFileContent
Sets the file content.- Parameters:
localFile- the local filecontent- the content
-
getFileContent
Gets the file content.- Parameters:
localFile- the local file- Returns:
- the file content
-
renameFile
Rename file.- Parameters:
path- the pathnewPath- the new path
-
copyFile
Copy file.- Parameters:
path- the pathnewPath- the new path
-
removeFileByPath
Removes the file by path.- Parameters:
path- the path
-
removeFolderByPath
Removes the folder by path.- Parameters:
path- the path
-
createFolder
Creates the folder.- Parameters:
normalizePath- the normalize path
-
renameFolder
Rename folder.- Parameters:
path- the pathnewPath- the new path
-
copyFolder
Copy folder.- Parameters:
path- the pathnewPath- the new path
-
getObjectByPath
Gets the object by path.- Parameters:
path- the path- Returns:
- the object by path
-
getChildrenByFolder
Gets the children by folder.- Parameters:
path- the path- Returns:
- the children by folder
-
fileExists
Check whether the file exists.- Parameters:
path- the path- Returns:
- true if exists
-
directoryExists
Check whether the directory exists.- Parameters:
path- the path- Returns:
- true if exists
-