public class AVMDiskDriver extends AlfrescoTxDiskDriver implements DiskInterface
Provides a filesystem interface for various protocols such as SMB/CIFS and FTP.
AlfrescoTxDiskDriver.CallableIO<V>, AlfrescoTxDiskDriver.PropagatingException| Modifier and Type | Field and Description |
|---|---|
static char |
AVM_SEPERATOR |
static String |
AVM_SEPERATOR_STR |
static int |
CustomFileStatus |
static int |
DirectoryExists |
static int |
FileExists |
static int |
FileNotExist |
static int |
FileUnknown |
static String |
RoleContentManager |
static String |
RoleNotWebAuthor |
static String |
RoleWebProject |
ioControlHandler, m_transactionService| Constructor and Description |
|---|
AVMDiskDriver()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNewStore(AVMContext avmCtx,
String storeName)
Add a new store to the top level folder list
|
protected AVMPath |
buildStorePath(AVMContext ctx,
String path,
SrvSession sess)
Build the full store path for a file/folder using the share relative path
|
void |
closeFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Close the file.
|
DeviceContext |
createContext(String shareName,
org.springframework.extensions.config.ConfigElement cfg)
Parse and validate the parameter string and create a device context object for this instance of the shared
device.
|
void |
createDirectory(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Create a new directory on this file system.
|
NetworkFile |
createFile(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Create a new file on the file system.
|
void |
deleteDirectory(SrvSession sess,
TreeConnection tree,
String dir)
Delete the directory from the filesystem.
|
void |
deleteFile(SrvSession sess,
TreeConnection tree,
String name)
Delete the specified file.
|
int |
fileExists(SrvSession sess,
TreeConnection tree,
String name)
Check if the specified file exists, and whether it is a file or directory.
|
protected FileState |
findPseudoState(AVMPath avmPath,
AVMContext avmCtx)
Find the file state for a pseudo folder path
|
void |
flushFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Flush any buffered output for the specified file.
|
AuthenticationService |
getAuthenticationService()
Return the authentication service
|
AVMService |
getAvmService()
Return the AVM service
|
StringList |
getAVMStoreNames()
Return a list of the available AVM store names
|
protected Map<org.alfresco.service.namespace.QName,PropertyValue> |
getAVMStoreProperties(String storeName)
Get the properties for a store
|
FileInfo |
getFileInformation(SrvSession sess,
TreeConnection tree,
String name)
Get the file information for the specified file.
|
boolean |
isReadOnly(SrvSession sess,
DeviceContext ctx)
Determine if the disk device is read-only.
|
NetworkFile |
openFile(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Open a file on the file system.
|
int |
readFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
byte[] buf,
int bufPos,
int siz,
long filePos)
Read a block of data from the specified file.
|
void |
registerContext(DeviceContext ctx)
Register a device context object for this instance of the shared
device.
|
void |
renameFile(SrvSession sess,
TreeConnection tree,
String oldName,
String newName)
Rename the specified file.
|
long |
seekFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long pos,
int typ)
Seek to the specified file position.
|
void |
setAuthenticationComponent(AuthenticationComponent authComponent)
Set the authentication component
|
void |
setAuthenticationService(AuthenticationService authService)
Set the authentication service
|
void |
setAvmService(AVMService avmService)
Set the AVM service
|
void |
setCreateStoreListener(CreateStoreTxnListener createStoreListener)
Set the create store listener
|
void |
setCreateVersionListener(CreateVersionTxnListener createVersionListener)
Set the create version listener
|
void |
setFileInformation(SrvSession sess,
TreeConnection tree,
String name,
FileInfo info)
Set the file information for the specified file.
|
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Set the mimetype service
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setPurgeStoreListener(PurgeStoreTxnListener purgeStoreListener)
Set the purge store listener
|
void |
setPurgeVersionListener(PurgeVersionTxnListener purgeVersionListener)
Set the purge version listener
|
void |
setWebProjectStore(String webStore)
Set the web project store
|
SearchContext |
startSearch(SrvSession sess,
TreeConnection tree,
String searchPath,
int attrib)
Start a new search on the filesystem using the specified searchPath that may contain wildcards.
|
void |
treeClosed(SrvSession sess,
TreeConnection tree)
Connection opened to this disk device
|
void |
treeOpened(SrvSession sess,
TreeConnection tree)
Connection closed to this device
|
void |
truncateFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long siz)
Truncate a file to the specified size
|
int |
writeFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
byte[] buf,
int bufoff,
int siz,
long fileoff)
Write a block of data to the file.
|
beginReadTransaction, beginWriteTransaction, doInWriteTransaction, endTransactiongetIoControlHandler, getServiceRegistry, getTransactionService, processIOControl, setIoControlHandler, setServiceRegistry, setTransactionServicepublic static final char AVM_SEPERATOR
public static final String AVM_SEPERATOR_STR
public static final String RoleContentManager
public static final String RoleWebProject
public static final String RoleNotWebAuthor
public static final int FileUnknown
public static final int FileNotExist
public static final int FileExists
public static final int DirectoryExists
public static final int CustomFileStatus
public final AVMService getAvmService()
public final AuthenticationService getAuthenticationService()
public void setAvmService(AVMService avmService)
avmService - AVMServicepublic void setAuthenticationComponent(AuthenticationComponent authComponent)
authComponent - AuthenticationComponentpublic void setAuthenticationService(AuthenticationService authService)
authService - AuthenticationServicepublic void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService - MimetypeServicepublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService - NodeServicepublic void setCreateStoreListener(CreateStoreTxnListener createStoreListener)
createStoreListener - CreateStoreTxnListenerpublic void setPurgeStoreListener(PurgeStoreTxnListener purgeStoreListener)
purgeStoreListener - PurgeStoreTxnListenerpublic void setCreateVersionListener(CreateVersionTxnListener createVersionListener)
createVersionListener - CreateVersionTxnListenerpublic void setPurgeVersionListener(PurgeVersionTxnListener purgeVersionListener)
purgeVersionListener - PurgeVersionTxnListenerpublic void setWebProjectStore(String webStore)
webStore - Stringpublic DeviceContext createContext(String shareName, org.springframework.extensions.config.ConfigElement cfg) throws DeviceContextException
createContext in interface DeviceInterfaceshareName - Stringcfg - ConfigElementDeviceContextExceptionpublic void registerContext(DeviceContext ctx) throws DeviceContextException
registerContext in interface ExtendedDiskInterfaceregisterContext in class AlfrescoDiskDrivercontext - the device contextserverConfig - ServerConfigurationBeanDeviceContextExceptionpublic final StringList getAVMStoreNames()
protected final Map<org.alfresco.service.namespace.QName,PropertyValue> getAVMStoreProperties(String storeName)
storeName - Stringprotected final AVMPath buildStorePath(AVMContext ctx, String path, SrvSession sess) throws AccessDeniedException
ctx - AVMContextpath - Stringsess - SrvSessionAccessDeniedExceptionpublic void closeFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws IOException
closeFile in interface DiskInterfacesess - Server sessiontree - Tree connection.file - Network file context.IOException - If an error occurs.public void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
createDirectory in interface DiskInterfacesess - Server sessiontree - Tree connection.params - Directory create parametersIOException - If an error occurs.public NetworkFile createFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
createFile in interface DiskInterfacesess - Server sessiontree - Tree connectionparams - File create parametersIOException - If an error occurs.public void deleteDirectory(SrvSession sess, TreeConnection tree, String dir) throws IOException
deleteDirectory in interface DiskInterfacesess - Server sessiontree - Tree connectiondir - Directory name.IOException - The exception description.public void deleteFile(SrvSession sess, TreeConnection tree, String name) throws IOException
deleteFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - NetworkFileIOException - The exception description.public int fileExists(SrvSession sess, TreeConnection tree, String name)
fileExists in interface DiskInterfacesess - Server sessiontree - Tree connectionname - java.lang.StringFileStatuspublic void flushFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws IOException
flushFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - Network file context.IOException - The exception description.public FileInfo getFileInformation(SrvSession sess, TreeConnection tree, String name) throws IOException
getFileInformation in interface DiskInterfacesess - Server sessiontree - Tree connectionname - File name/path that information is required for.IOException - The exception description.public boolean isReadOnly(SrvSession sess, DeviceContext ctx) throws IOException
isReadOnly in interface DiskInterfacesess - Server sessionctx - Device contextIOException - If an error occurs.public NetworkFile openFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
openFile in interface DiskInterfacesess - Server sessiontree - Tree connectionparams - File open parametersIOException - If an error occurs.public int readFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufPos, int siz, long filePos) throws IOException
readFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network filebuf - Buffer to return data tobufPos - Starting position in the return buffersiz - Maximum size of data to returnfilePos - File offset to read dataIOException - The exception description.public void renameFile(SrvSession sess, TreeConnection tree, String oldName, String newName) throws IOException
renameFile in interface DiskInterfacesess - Server sessiontree - Tree connectionoldName - java.lang.StringnewName - java.lang.StringIOException - The exception description.public long seekFile(SrvSession sess, TreeConnection tree, NetworkFile file, long pos, int typ) throws IOException
seekFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - Network file.pos - Position to seek to.typ - Seek type.IOExceptionpublic void setFileInformation(SrvSession sess, TreeConnection tree, String name, FileInfo info) throws IOException
setFileInformation in interface DiskInterfacesess - Server sessiontree - Tree connectionname - java.lang.Stringinfo - FileInfoIOException - The exception description.public SearchContext startSearch(SrvSession sess, TreeConnection tree, String searchPath, int attrib) throws FileNotFoundException
startSearch in interface DiskInterfacesess - Server sessiontree - Tree connectionsearchPath - File(s) to search for, may include wildcards.attrib - Attributes of the file(s) to search for, see class SMBFileAttribute.FileNotFoundException - If the search could not be started.public void truncateFile(SrvSession sess, TreeConnection tree, NetworkFile file, long siz) throws IOException
truncateFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - Network file detailssiz - New file lengthIOException - The exception description.public int writeFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufoff, int siz, long fileoff) throws IOException
writeFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - Network file detailsbuf - byte[] Data to be writtenbufoff - Offset within the buffer that the data startssiz - int Data lengthfileoff - Position within the file that the data is to be written.IOException - The exception description.public void treeClosed(SrvSession sess, TreeConnection tree)
treeClosed in interface DeviceInterfacesess - Server sessiontree - Tree connectionpublic void treeOpened(SrvSession sess, TreeConnection tree)
treeOpened in interface DeviceInterfacesess - Server sessiontree - Tree connectionprotected final FileState findPseudoState(AVMPath avmPath, AVMContext avmCtx)
avmPath - AVMPathavmCtx - AVMContextprotected void addNewStore(AVMContext avmCtx, String storeName)
avmCtx - AVMContextstoreName - StringCopyright © 2005–2014 Alfresco Software. All rights reserved.