public interface FilesService
Modifier and Type | Method and Description |
---|---|
Topic |
createFile(InputStream in,
String path)
Creates a file in the file repository, and creates a corresponding File topic.
|
void |
createFolder(String folderName,
String path)
Creates a folder in the file repository.
|
Topic |
getChildFileTopic(long folderTopicId,
String path)
Returns the File topic representing the file at a given repository path.
|
Topic |
getChildFolderTopic(long folderTopicId,
String path)
Returns the Folder topic representing the folder at a given repository path.
|
DirectoryListing |
getDirectoryListing(String path) |
File |
getFile(long fileTopicId)
Accesses a file/directory in the file repository that is represented by the given File/Folder topic.
|
File |
getFile(String path)
Accesses a file/directory in the file repository by the given repository path.
|
Topic |
getFileTopic(String path)
Returns the File topic representing the file at a given repository path.
|
Topic |
getFolderTopic(String path)
Returns the Folder topic representing the folder at a given repository path.
|
String |
getRepositoryPath(URL url)
Checks if the given URL refers to the file repository of this DeepaMehta installation.
|
ResourceInfo |
getResourceInfo(String path) |
void |
openFile(long fileTopicId) |
StoredFile |
storeFile(UploadedFile file,
String path)
Receives an uploaded file, stores it in the file repository, and creates a corresponding File topic.
|
Topic getFileTopic(String path)
path
- A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.Topic getFolderTopic(String path)
path
- A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.Topic getChildFileTopic(long folderTopicId, String path)
Creates an association (type "Aggregation") between the File topic (role type "Child") and its parent Folder topic (role type "Parent"), if not exists already.
path
- A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.folderTopicId
- ID of the parent Folder topic.Topic getChildFolderTopic(long folderTopicId, String path)
Creates an association (type "Aggregation") between the Folder topic (role type "Child") and its parent Folder topic (role type "Parent"), if not exists already.
path
- A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.folderTopicId
- ID of the parent Folder topic.StoredFile storeFile(UploadedFile file, String path)
path
- The directory where to store the uploaded file.
A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
The directory must exist.Topic createFile(InputStream in, String path)
in
- The input stream the file content is read from.path
- The path and filename of the file to be created.
A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
If that file exists already it is overwritten. ### TODO: rethink overwritingvoid createFolder(String folderName, String path)
path
- The directory where to create the folder.
A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.ResourceInfo getResourceInfo(String path)
DirectoryListing getDirectoryListing(String path)
String getRepositoryPath(URL url)
null
if the URL
does not refer to the file repository of this DeepaMehta installation.File getFile(String path)
path
- A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.File getFile(long fileTopicId)
void openFile(long fileTopicId)
Copyright © 2015. All Rights Reserved.