public class SimpleFileLoader extends 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(String dir,
int fid)
Create a directory
|
void |
deleteDirectory(String dir,
int fid)
Delete a directory
|
void |
deleteFile(String fname,
int fid,
int stid)
Delete a file
|
int |
getRequiredDBFeatures()
Return the database features required by this file loader.
|
protected 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(String curName,
int fid,
String newName,
boolean isdir)
Rename a file or directory
|
void |
setContext(DBDeviceContext dbCtx)
Set the database context
|
void |
setFileInformation(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 IOException, FileNotFoundException
openFile in interface FileLoaderparams - FileOpenParamsfid - intstid - intdid - intcreate - booleandir - booleanIOExceptionFileNotFoundExceptionpublic void closeFile(SrvSession sess, NetworkFile netFile) throws IOException
closeFile in interface FileLoadersess - SrvSessionnetFile - NetworkFileIOExceptionpublic void deleteFile(String fname, int fid, int stid) throws IOException
deleteFile in interface FileLoaderfname - Stringfid - intstid - intIOExceptionpublic void createDirectory(String dir, int fid) throws IOException
createDirectory in interface NamedFileLoaderdir - Stringfid - intIOExceptionpublic void deleteDirectory(String dir, int fid) throws IOException
deleteDirectory in interface NamedFileLoaderdir - Stringfid - intIOExceptionpublic void setFileInformation(String path, int fid, FileInfo finfo) throws IOException
setFileInformation in interface NamedFileLoaderpath - Stringfid - intfinfo - FileInfoIOExceptionpublic void renameFileDirectory(String curName, int fid, String newName, boolean isdir) throws IOException
renameFileDirectory in interface NamedFileLoadercurName - Stringfid - intnewName - Stringisdir - booleanIOExceptionprotected final 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 - FileProcessorFileLoaderExceptionpublic final void setContext(DBDeviceContext dbCtx)
setContext in interface FileLoaderdbCtx - DBDeviceContextCopyright © 2005–2016 Alfresco Software. All rights reserved.