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 FileLoader
public NetworkFile openFile(FileOpenParams params, int fid, int stid, int did, boolean create, boolean dir) throws java.io.IOException, java.io.FileNotFoundException
openFile
in interface FileLoader
params
- FileOpenParamsfid
- intstid
- intdid
- intcreate
- booleandir
- booleanjava.io.IOException
java.io.FileNotFoundException
public void closeFile(SrvSession sess, NetworkFile netFile) throws java.io.IOException
closeFile
in interface FileLoader
sess
- SrvSessionnetFile
- NetworkFilejava.io.IOException
public void deleteFile(java.lang.String fname, int fid, int stid) throws java.io.IOException
deleteFile
in interface FileLoader
fname
- Stringfid
- intstid
- intjava.io.IOException
public void createDirectory(java.lang.String dir, int fid) throws java.io.IOException
createDirectory
in interface NamedFileLoader
dir
- Stringfid
- intjava.io.IOException
public void deleteDirectory(java.lang.String dir, int fid) throws java.io.IOException
deleteDirectory
in interface NamedFileLoader
dir
- Stringfid
- intjava.io.IOException
public void setFileInformation(java.lang.String path, int fid, FileInfo finfo) throws java.io.IOException
setFileInformation
in interface NamedFileLoader
path
- Stringfid
- intfinfo
- FileInfojava.io.IOException
public void renameFileDirectory(java.lang.String curName, int fid, java.lang.String newName, boolean isdir) throws java.io.IOException
renameFileDirectory
in interface NamedFileLoader
curName
- Stringfid
- intnewName
- Stringisdir
- booleanjava.io.IOException
protected final java.lang.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
- FileLoaderException
public final void setContext(DBDeviceContext dbCtx)
setContext
in interface FileLoader
dbCtx
- DBDeviceContextCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.