|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Connector
Backend interface of a File Browser connector. A connector serves and manages
files and folders accessed through the File Browser on an arbitrary backend
system.
The connector will receive a request if, and only if, the request was valid
in terms of valid and reasonable parameters up to an abstract point which is
independent from a specific connector implementation.
Helpful classes and methods:
ThreadLocalData class.RequestCycleHandler.getUserFilesAbsolutePath,
AbstractLocalFileSystemConnector.getRealUserFilesAbsolutePath (if use it) to
resolve the real path or simply do it yourself.
| Field Summary | |
|---|---|
static String |
KEY_NAME
Key 'name' for a file's name |
static String |
KEY_SIZE
Key 'size' for a file's length |
| Method Summary | |
|---|---|
void |
createFolder(ResourceType type,
String currentFolder,
String newFolder)
Creates a new folder on the backend. |
String |
fileUpload(ResourceType type,
String currentFolder,
String fileName,
InputStream inputStream)
Uploads a new file on to the backend. |
List<Map<String,Object>> |
getFiles(ResourceType type,
String currentFolder)
Returns a list of file attributes from the backend. |
List<String> |
getFolders(ResourceType type,
String currentFolder)
Returns a list of folders from the backend. |
void |
init(ServletContext servletContext)
Initializes this connector. |
| Field Detail |
|---|
static final String KEY_NAME
static final String KEY_SIZE
| Method Detail |
|---|
void init(ServletContext servletContext)
throws Exception
dispatcher
initialization.
servletContext - reference to the ServletContext in which the caller is
running
Exception - if the connector initialization fails due to some reason
List<Map<String,Object>> getFiles(ResourceType type,
String currentFolder)
throws InvalidCurrentFolderException,
ReadException
Number, its
long value will be taken as the final value.
type - the current resource typecurrentFolder - the current folder
InvalidCurrentFolderException - if the current folder name is invalid or does not exist
within the underlying backend
ReadException - if the file attributes could not be read due to some reason
List<String> getFolders(ResourceType type,
String currentFolder)
throws InvalidCurrentFolderException,
ReadException
type - the current resource typecurrentFolder - the current folder
InvalidCurrentFolderException - if the current folder name is invalid or does not exist
within the underlying backend
ReadException - if the folder names could not be read due to some reason
void createFolder(ResourceType type,
String currentFolder,
String newFolder)
throws InvalidCurrentFolderException,
InvalidNewFolderNameException,
FolderAlreadyExistsException,
WriteException
type - the current resource typecurrentFolder - the current foldernewFolder - name of the new folder
InvalidCurrentFolderException - if the current folder name is invalid or does not exist
within the underlying backend
InvalidNewFolderNameException - if the new folder name is invalid due to some reason
FolderAlreadyExistsException - if the new folder already exists
WriteException - if the new folder could not be created due to some reason
String fileUpload(ResourceType type,
String currentFolder,
String fileName,
InputStream inputStream)
throws InvalidCurrentFolderException,
WriteException
type - the current resource typecurrentFolder - the current folderfileName - the name of the new fileinputStream - input stream of the new file
InvalidCurrentFolderException - if the current folder name is invalid or does not exist
within the underlying backend
WriteException - if the new file could not be created due to some reason
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||