|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.deepamehta.core.osgi.PluginActivator
de.deepamehta.plugins.files.FilesPlugin
public class FilesPlugin
| Field Summary | |
|---|---|
static de.deepamehta.core.service.DeepaMehtaEvent |
CHECK_DISK_QUOTA
|
static int |
DISK_QUOTA_MB
|
static String |
FILE_REPOSITORY_PATH
|
static boolean |
FILE_REPOSITORY_PER_WORKSPACE
|
| Fields inherited from class de.deepamehta.core.osgi.PluginActivator |
|---|
bundle, dms |
| Constructor Summary | |
|---|---|
FilesPlugin()
|
|
| Method Summary | |
|---|---|
de.deepamehta.core.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. |
de.deepamehta.core.Topic |
getChildFileTopic(long folderTopicId,
String path)
Returns the File topic representing the file at a given repository path. |
de.deepamehta.core.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. |
de.deepamehta.core.Topic |
getFileTopic(String path)
Returns the File topic representing the file at a given repository path. |
de.deepamehta.core.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 |
init()
|
void |
openFile(long fileTopicId)
|
void |
preInstall()
|
String |
repoPath(File path)
Maps an absolute path to a repository path. |
String |
repoPath(javax.servlet.http.HttpServletRequest request)
Returns the repository path of a filerepo request. |
void |
resourceRequestFilter(javax.servlet.http.HttpServletRequest request)
|
void |
shutdown()
|
StoredFile |
storeFile(UploadedFile file,
String path)
Receives an uploaded file, stores it in the file repository, and creates a corresponding File topic. |
| Methods inherited from class de.deepamehta.core.osgi.PluginActivator |
|---|
getBundleContext, getPluginName, getStaticResource, getUri, publishFileSystem, serviceArrived, serviceGone, setCoreService, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String FILE_REPOSITORY_PATH
public static final boolean FILE_REPOSITORY_PER_WORKSPACE
public static final int DISK_QUOTA_MB
public static de.deepamehta.core.service.DeepaMehtaEvent CHECK_DISK_QUOTA
| Constructor Detail |
|---|
public FilesPlugin()
| Method Detail |
|---|
public de.deepamehta.core.Topic getFileTopic(String path)
FilesService
getFileTopic in interface FilesServicepath - A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
public de.deepamehta.core.Topic getFolderTopic(String path)
FilesService
getFolderTopic in interface FilesServicepath - A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
public de.deepamehta.core.Topic getChildFileTopic(long folderTopicId,
String path)
FilesServiceCreates an association (type "Aggregation") between the File topic (role type "Child") and its parent Folder topic (role type "Parent"), if not exists already.
getChildFileTopic in interface FilesServicefolderTopicId - ID of the parent Folder topic.path - A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
public de.deepamehta.core.Topic getChildFolderTopic(long folderTopicId,
String path)
FilesServiceCreates an association (type "Aggregation") between the Folder topic (role type "Child") and its parent Folder topic (role type "Parent"), if not exists already.
getChildFolderTopic in interface FilesServicefolderTopicId - ID of the parent Folder topic.path - A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.
public StoredFile storeFile(UploadedFile file,
String path)
FilesService
storeFile in interface FilesServicepath - 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.
public de.deepamehta.core.Topic createFile(InputStream in,
String path)
FilesService
createFile in interface FilesServicein - 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 overwriting
public void createFolder(String folderName,
String path)
FilesService
createFolder in interface FilesServicepath - 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.public ResourceInfo getResourceInfo(String path)
getResourceInfo in interface FilesServicepublic DirectoryListing getDirectoryListing(String path)
getDirectoryListing in interface FilesServicepublic String getRepositoryPath(URL url)
FilesService
getRepositoryPath in interface FilesServicenull if the URL
does not refer to the file repository of this DeepaMehta installation.public File getFile(String path)
FilesService
getFile in interface FilesServicepath - A repository path. Relative to the repository base path.
Must begin with slash, no slash at the end.public File getFile(long fileTopicId)
FilesService
getFile in interface FilesServicepublic void openFile(long fileTopicId)
openFile in interface FilesServicepublic void preInstall()
preInstall in interface de.deepamehta.core.osgi.PluginContextpreInstall in class de.deepamehta.core.osgi.PluginActivatorpublic void init()
init in interface de.deepamehta.core.osgi.PluginContextinit in class de.deepamehta.core.osgi.PluginActivatorpublic void shutdown()
shutdown in interface de.deepamehta.core.osgi.PluginContextshutdown in class de.deepamehta.core.osgi.PluginActivatorpublic void resourceRequestFilter(javax.servlet.http.HttpServletRequest request)
resourceRequestFilter in interface de.deepamehta.core.service.event.ResourceRequestFilterListenerpublic String repoPath(File path)
path - An absolute path.public String repoPath(javax.servlet.http.HttpServletRequest request)
null if the request is not a filerepo request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||