|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.deepamehta.core.osgi.PluginActivator de.deepamehta.plugins.files.FilesPlugin
public class FilesPlugin
Field Summary | |
---|---|
private static String |
FILE_REPOSITORY_PATH
|
private static String |
FILE_REPOSITORY_URI
|
private Logger |
logger
|
Fields inherited from class de.deepamehta.core.osgi.PluginActivator |
---|
bundle, dms |
Constructor Summary | |
---|---|
FilesPlugin()
|
Method Summary | |
---|---|
private void |
associateChildTopic(long folderTopicId,
long childTopicId)
|
private void |
checkFileExistence(File file)
|
private void |
checkFilePath(File file)
Prerequisite: the file's path is canonical. |
private boolean |
childAssociationExists(long folderTopicId,
long childTopicId)
|
Topic |
createChildFileTopic(long folderTopicId,
String path,
ClientState clientState)
|
Topic |
createChildFolderTopic(long folderTopicId,
String path,
ClientState clientState)
|
private Topic |
createFileTopic(File file,
ClientState clientState)
|
Topic |
createFileTopic(String path,
ClientState clientState)
Creates a File topic for a given path. |
void |
createFolder(String folderName,
String path)
|
private Topic |
createFolderTopic(File file,
ClientState clientState)
|
Topic |
createFolderTopic(String path,
ClientState clientState)
Creates a Folder topic for a given path. |
private File |
enforeSecurity(String path)
|
private Topic |
fetchFileTopic(File file)
|
private Topic |
fetchFolderTopic(File file)
|
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 its path. |
String |
getRepositoryPath(URL url)
Checks if the given URL refers to the file repository of this DeepaMehta installation. |
ResourceInfo |
getResourceInfo(String path)
|
boolean |
handleSecurity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
init()
|
void |
openFile(long fileTopicId)
|
private File |
repoFile(File directory,
String fileName)
|
private File |
repoFile(File directory,
UploadedFile file)
Calculates the storage location for the uploaded file. |
private File |
repoFile(String path)
Maps a repository path to a repository file. |
private String |
repoPath(File file)
Maps a repository file to a repository path. |
private String |
repoPath(long fileTopicId)
|
StoredFile |
storeFile(UploadedFile file,
String path,
ClientState clientState)
|
Methods inherited from class de.deepamehta.core.osgi.PluginActivator |
---|
getBundleContext, postInstall, publishDirectory, 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 |
---|
private static final String FILE_REPOSITORY_PATH
private static final String FILE_REPOSITORY_URI
private Logger logger
Constructor Detail |
---|
public FilesPlugin()
Method Detail |
---|
public Topic createFileTopic(String path, @HeaderParam(value="Cookie") ClientState clientState)
FilesService
createFileTopic
in interface FilesService
public Topic createFolderTopic(String path, @HeaderParam(value="Cookie") ClientState clientState)
FilesService
createFolderTopic
in interface FilesService
public Topic createChildFileTopic(long folderTopicId, String path, @HeaderParam(value="Cookie") ClientState clientState)
createChildFileTopic
in interface FilesService
public Topic createChildFolderTopic(long folderTopicId, String path, @HeaderParam(value="Cookie") ClientState clientState)
createChildFolderTopic
in interface FilesService
public StoredFile storeFile(UploadedFile file, String path, @HeaderParam(value="Cookie") ClientState clientState)
storeFile
in interface FilesService
path
- The directory where to store the file. Relative to the file repository root path.
Must begin with slash ('/'), no slash at the end.
The directory must exist.public void createFolder(String folderName, String path)
createFolder
in interface FilesService
public ResourceInfo getResourceInfo(String path)
getResourceInfo
in interface FilesService
public DirectoryListing getDirectoryListing(String path)
getDirectoryListing
in interface FilesService
public String getRepositoryPath(URL url)
FilesService
getRepositoryPath
in interface FilesService
null
if the URL
does not refer to the file repository of this DeepaMehta installation.public File getFile(String path)
FilesService
getFile
in interface FilesService
path
- a file repository path. Must begin with slash ('/'), no slash at the end.public File getFile(long fileTopicId)
FilesService
getFile
in interface FilesService
public void openFile(long fileTopicId)
openFile
in interface FilesService
public boolean handleSecurity(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
handleSecurity
in interface SecurityHandler
public void init()
init
in interface PluginContext
init
in class PluginActivator
private Topic fetchFileTopic(File file)
private Topic fetchFolderTopic(File file)
private Topic createFileTopic(File file, ClientState clientState)
private Topic createFolderTopic(File file, ClientState clientState)
private void associateChildTopic(long folderTopicId, long childTopicId)
private boolean childAssociationExists(long folderTopicId, long childTopicId)
private File repoFile(String path)
private File repoFile(File directory, UploadedFile file)
private File repoFile(File directory, String fileName)
private String repoPath(File file)
private String repoPath(long fileTopicId)
private File enforeSecurity(String path) throws FileRepositoryException
FileRepositoryException
private void checkFilePath(File file) throws FileRepositoryException
FileRepositoryException
private void checkFileExistence(File file) throws FileRepositoryException
FileRepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |