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 FileLoader
public NetworkFile openFile(FileOpenParams params, int fid, int stid, int did, boolean create, boolean dir) throws IOException, FileNotFoundException
openFile
in interface FileLoader
params
- FileOpenParamsfid
- intstid
- intdid
- intcreate
- booleandir
- booleanIOException
FileNotFoundException
public void closeFile(SrvSession sess, NetworkFile netFile) throws IOException
closeFile
in interface FileLoader
sess
- SrvSessionnetFile
- NetworkFileIOException
public void deleteFile(String fname, int fid, int stid) throws IOException
deleteFile
in interface FileLoader
fname
- Stringfid
- intstid
- intIOException
public void createDirectory(String dir, int fid) throws IOException
createDirectory
in interface NamedFileLoader
dir
- Stringfid
- intIOException
public void deleteDirectory(String dir, int fid) throws IOException
deleteDirectory
in interface NamedFileLoader
dir
- Stringfid
- intIOException
public void setFileInformation(String path, int fid, FileInfo finfo) throws IOException
setFileInformation
in interface NamedFileLoader
path
- Stringfid
- intfinfo
- FileInfoIOException
public void renameFileDirectory(String curName, int fid, String newName, boolean isdir) throws IOException
renameFileDirectory
in interface NamedFileLoader
curName
- Stringfid
- intnewName
- Stringisdir
- booleanIOException
protected final String getRootPath()
public void initializeLoader(org.springframework.extensions.config.ConfigElement params, DeviceContext ctx) throws FileLoaderException
initializeLoader
in interface FileLoader
params
- ConfigElementctx
- DeviceContextFileLoaderException
public final void queueFileRequest(FileRequest fileReq)
queueFileRequest
in interface FileLoader
fileReq
- FileRequestpublic void startLoader(DeviceContext ctx)
startLoader
in interface FileLoader
ctx
- DeviceContextpublic void shutdownLoader(boolean immediate)
shutdownLoader
in interface FileLoader
immediate
- booleanpublic boolean supportsStreams()
supportsStreams
in interface FileLoader
public void addFileProcessor(FileProcessor fileProc) throws FileLoaderException
addFileProcessor
in interface FileLoader
fileProc
- FileProcessorFileLoaderException
public final void setContext(DBDeviceContext dbCtx)
setContext
in interface FileLoader
dbCtx
- DBDeviceContextCopyright © 2005–2017 Alfresco Software. All rights reserved.