public class SimpleFileLoader extends java.lang.Object implements FileLoader, NamedFileLoader
The simple file loader class maps the file load/store requests to files within the local filesystem.
| Constructor and Description |
|---|
SimpleFileLoader()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileProcessor(FileProcessor fileProc)
Add a file processor to process files before storing and after loading.
|
void |
closeFile(SrvSession sess,
NetworkFile netFile)
Close the network file
|
void |
createDirectory(java.lang.String dir,
int fid)
Create a directory
|
void |
deleteDirectory(java.lang.String dir,
int fid)
Delete a directory
|
void |
deleteFile(java.lang.String fname,
int fid,
int stid)
Delete a file
|
int |
getRequiredDBFeatures()
Return the database features required by this file loader.
|
protected java.lang.String |
getRootPath()
Return the root path
|
void |
initializeLoader(org.springframework.extensions.config.ConfigElement params,
DeviceContext ctx)
Initialize the file loader using the specified parameters
|
NetworkFile |
openFile(FileOpenParams params,
int fid,
int stid,
int did,
boolean create,
boolean dir)
Open/create a file
|
void |
queueFileRequest(FileRequest fileReq)
Load/save file data, not implemented in this loader.
|
void |
renameFileDirectory(java.lang.String curName,
int fid,
java.lang.String newName,
boolean isdir)
Rename a file or directory
|
void |
setContext(DBDeviceContext dbCtx)
Set the database context
|
void |
setFileInformation(java.lang.String path,
int fid,
FileInfo finfo)
Set file information
|
void |
shutdownLoader(boolean immediate)
Shutdown the file loader and release all resources
|
void |
startLoader(DeviceContext ctx)
Start the file loader
|
boolean |
supportsStreams()
Indicate that the file loader does not support NTFS streams
|
public int getRequiredDBFeatures()
getRequiredDBFeatures in interface FileLoaderpublic NetworkFile openFile(FileOpenParams params, int fid, int stid, int did, boolean create, boolean dir) throws java.io.IOException, java.io.FileNotFoundException
openFile in interface FileLoaderparams - FileOpenParamsfid - intstid - intdid - intcreate - booleandir - booleanjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic void closeFile(SrvSession sess, NetworkFile netFile) throws java.io.IOException
closeFile in interface FileLoadersess - SrvSessionnetFile - NetworkFilejava.io.IOExceptionpublic void deleteFile(java.lang.String fname,
int fid,
int stid)
throws java.io.IOException
deleteFile in interface FileLoaderfname - Stringfid - intstid - intjava.io.IOExceptionpublic void createDirectory(java.lang.String dir,
int fid)
throws java.io.IOException
createDirectory in interface NamedFileLoaderdir - Stringfid - intjava.io.IOExceptionpublic void deleteDirectory(java.lang.String dir,
int fid)
throws java.io.IOException
deleteDirectory in interface NamedFileLoaderdir - Stringfid - intjava.io.IOExceptionpublic void setFileInformation(java.lang.String path,
int fid,
FileInfo finfo)
throws java.io.IOException
setFileInformation in interface NamedFileLoaderpath - Stringfid - intfinfo - FileInfojava.io.IOExceptionpublic void renameFileDirectory(java.lang.String curName,
int fid,
java.lang.String newName,
boolean isdir)
throws java.io.IOException
renameFileDirectory in interface NamedFileLoadercurName - Stringfid - intnewName - Stringisdir - booleanjava.io.IOExceptionprotected final java.lang.String getRootPath()
public void initializeLoader(org.springframework.extensions.config.ConfigElement params,
DeviceContext ctx)
throws FileLoaderException
initializeLoader in interface FileLoaderparams - ConfigElementctx - DeviceContextFileLoaderExceptionpublic final void queueFileRequest(FileRequest fileReq)
queueFileRequest in interface FileLoaderfileReq - FileRequestpublic void startLoader(DeviceContext ctx)
startLoader in interface FileLoaderctx - DeviceContextpublic void shutdownLoader(boolean immediate)
shutdownLoader in interface FileLoaderimmediate - booleanpublic boolean supportsStreams()
supportsStreams in interface FileLoaderpublic void addFileProcessor(FileProcessor fileProc) throws FileLoaderException
addFileProcessor in interface FileLoaderfileProc - FileLoaderExceptionpublic final void setContext(DBDeviceContext dbCtx)
setContext in interface FileLoaderdbCtx - DBDeviceContextCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.