|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.fckeditor.connector.impl.AbstractLocalFileSystemConnector
public abstract class AbstractLocalFileSystemConnector
Abstract local filesystem backend connector. This class is the default implementation of the official connector specification.
It serves files and folders against a specific local directory which is resolved in a subclass. You cannot use this class directly, instead you have to subclass it and implement the abstract methods and override methods if necessary.
Field Summary | |
---|---|
protected ServletContext |
servletContext
|
Fields inherited from interface net.fckeditor.connector.Connector |
---|
KEY_NAME, KEY_SIZE |
Constructor Summary | |
---|---|
AbstractLocalFileSystemConnector()
|
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. |
protected static File |
getOrCreateResourceTypeDir(String baseDir,
ResourceType type)
Returns a file reference to a created resource type directory. |
protected abstract String |
getRealUserFilesAbsolutePath(String userFilesAbsolutePath)
Resolves a provided userfiles absolute path against a specific backend. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.fckeditor.connector.Connector |
---|
init |
Field Detail |
---|
protected ServletContext servletContext
Constructor Detail |
---|
public AbstractLocalFileSystemConnector()
Method Detail |
---|
public String fileUpload(ResourceType type, String currentFolder, String fileName, InputStream inputStream) throws InvalidCurrentFolderException, WriteException
Connector
fileUpload
in interface Connector
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 reasonpublic void createFolder(ResourceType type, String currentFolder, String newFolder) throws InvalidCurrentFolderException, InvalidNewFolderNameException, FolderAlreadyExistsException
Connector
createFolder
in interface Connector
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 existspublic List<Map<String,Object>> getFiles(ResourceType type, String currentFolder) throws InvalidCurrentFolderException
Connector
Number
, its
long value will be taken as the final value.
getFiles
in interface Connector
type
- the current resource typecurrentFolder
- the current folder
InvalidCurrentFolderException
- if the current folder name is invalid or does not exist
within the underlying backendpublic List<String> getFolders(ResourceType type, String currentFolder) throws InvalidCurrentFolderException
Connector
getFolders
in interface Connector
type
- the current resource typecurrentFolder
- the current folder
InvalidCurrentFolderException
- if the current folder name is invalid or does not exist
within the underlying backendprotected abstract String getRealUserFilesAbsolutePath(String userFilesAbsolutePath)
UserPathBuilder.getUserFilesAbsolutePath
.
The return value has to be consistent within the entire request cycle.
userFilesAbsolutePath
- the userfiles absolute path to resolve against a specific
backend
protected static File getOrCreateResourceTypeDir(String baseDir, ResourceType type)
baseDir
- the current resource type's base directorytype
- the current resource type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |