public class EnhJavaFileDiskDriver extends Object implements DiskInterface, FileLockingInterface
| Modifier and Type | Field and Description |
|---|---|
protected static long |
_globalCreateDate |
| Constructor and Description |
|---|
EnhJavaFileDiskDriver()
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected FileInfo |
buildFileInformation(String path,
String relPath)
Build the file information for the specified file/directory, if it exists.
|
void |
closeFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Close the specified file
|
DeviceContext |
createContext(String shareName,
org.springframework.extensions.config.ConfigElement args)
Parse and validate the parameter string and create a device context for this share
|
void |
createDirectory(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Create a new directory
|
NetworkFile |
createFile(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Create a new file
|
void |
deleteDirectory(SrvSession sess,
TreeConnection tree,
String dir)
Delete a directory
|
void |
deleteFile(SrvSession sess,
TreeConnection tree,
String name)
Delete a file
|
int |
fileExists(SrvSession sess,
TreeConnection tree,
String name)
Check if the specified file exists, and it is a file.
|
void |
flushFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Flush buffered data for the specified file
|
FileInfo |
getFileInformation(SrvSession sess,
TreeConnection tree,
String name)
Return file information about the specified file
|
static long |
getGlobalCreateDateTime()
Return the global file creation date/time
|
LockManager |
getLockManager(SrvSession sess,
TreeConnection tree)
Return the lock manager implementation associated with this virtual filesystem
|
boolean |
isReadOnly(SrvSession sess,
DeviceContext ctx)
Determine if the disk device is read-only.
|
protected String |
mapPath(String path)
Map the input path to a real path, this may require changing the case of various parts of the
path.
|
protected String |
mapPath(String base,
String path)
Map the input path to a real path, this may require changing the case of various parts of the
path.
|
NetworkFile |
openFile(SrvSession sess,
TreeConnection tree,
FileOpenParams params)
Open a file
|
int |
readFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
byte[] buf,
int bufPos,
int siz,
long filePos)
Read a block of data from a file
|
void |
renameFile(SrvSession sess,
TreeConnection tree,
String oldName,
String newName)
Rename a file
|
long |
seekFile(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long pos,
int typ)
Seek to the specified point within a file
|
void |
setFileInformation(SrvSession sess,
TreeConnection tree,
String name,
FileInfo info)
Set file information
|
SearchContext |
startSearch(SrvSession sess,
TreeConnection tree,
String searchPath,
int attrib)
Start a file search
|
void |
treeClosed(SrvSession sess,
TreeConnection tree)
Connection closed to this device
|
void |
treeOpened(SrvSession sess,
TreeConnection tree)
Connection opened to this disk 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 a file
|
protected FileInfo buildFileInformation(String path, String relPath)
path - StringrelPath - Stringpublic void closeFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws IOException
closeFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network file detailsIOExceptionpublic void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
createDirectory in interface DiskInterfacesess - Session detailstree - Tree connectionparams - Directory parametersIOExceptionpublic NetworkFile createFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
createFile in interface DiskInterfacesess - Session detailstree - Tree connectionparams - File open parametersIOExceptionpublic void deleteDirectory(SrvSession sess, TreeConnection tree, String dir) throws IOException
deleteDirectory in interface DiskInterfacesess - Session detailstree - Tree connectiondir - Path of directory to deleteIOExceptionpublic void deleteFile(SrvSession sess, TreeConnection tree, String name) throws IOException
deleteFile in interface DiskInterfacesess - Session detailstree - Tree connectionname - Name of file to deleteIOExceptionpublic int fileExists(SrvSession sess, TreeConnection tree, String name)
fileExists in interface DiskInterfacesess - Session detailstree - Tree connectionname - File nameFileStatuspublic void flushFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws IOException
flushFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network fileIOExceptionpublic FileInfo getFileInformation(SrvSession sess, TreeConnection tree, String name) throws IOException
getFileInformation in interface DiskInterfacesess - Session detailstree - Tree connectionname - File nameIOExceptionpublic boolean isReadOnly(SrvSession sess, DeviceContext ctx) throws IOException
isReadOnly in interface DiskInterfacesess - Session detailsctx - Device contextIOException - If an error occurs.protected final String mapPath(String path) throws FileNotFoundException, PathNotFoundException
path - Share relative pathFileNotFoundExceptionPathNotFoundExceptionprotected final String mapPath(String base, String path) throws FileNotFoundException, PathNotFoundException
base - java.lang.Stringpath - java.lang.StringFileNotFoundException - The path could not be mapped to a real path.PathNotFoundException - Part of the path is not validpublic NetworkFile openFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
openFile in interface DiskInterfacesess - Session detailstree - Tree connectionparams - File open parametersIOExceptionpublic 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 dataIOExceptionpublic void renameFile(SrvSession sess, TreeConnection tree, String oldName, String newName) throws IOException
renameFile in interface DiskInterfacesess - Session detailstree - Tree connectionoldName - Existing file namenewName - New file nameIOExceptionpublic long seekFile(SrvSession sess, TreeConnection tree, NetworkFile file, long pos, int typ) throws IOException
seekFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network filepos - New file positiontyp - Seek typeIOExceptionpublic void setFileInformation(SrvSession sess, TreeConnection tree, String name, FileInfo info) throws IOException
setFileInformation in interface DiskInterfacesess - Session detailstree - Tree connectionname - File nameinfo - File information to be setIOExceptionpublic SearchContext startSearch(SrvSession sess, TreeConnection tree, String searchPath, int attrib) throws FileNotFoundException
startSearch in interface DiskInterfacesess - Session detailstree - Tree connectionsearchPath - Search path, may include wildcardsattrib - Search attributesFileNotFoundExceptionpublic 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 - Session detailstree - Tree connectionfile - Network filebuf - Data to be writtenbufoff - Offset of data within the buffersiz - Number of bytes to be writtenfileoff - Offset within the file to start writing the dataIOException - The exception description.public DeviceContext createContext(String shareName, org.springframework.extensions.config.ConfigElement args) throws DeviceContextException
createContext in interface DeviceInterfaceshareName - Stringargs - ConfigElementDeviceContextExceptionpublic void treeOpened(SrvSession sess, TreeConnection tree)
treeOpened in interface DeviceInterfacesess - Server sessiontree - Tree connectionpublic void treeClosed(SrvSession sess, TreeConnection tree)
treeClosed in interface DeviceInterfacesess - Server sessiontree - Tree connectionpublic static final long getGlobalCreateDateTime()
public LockManager getLockManager(SrvSession sess, TreeConnection tree)
getLockManager in interface FileLockingInterfacesess - SrvSessiontree - TreeConnectionCopyright © 2005–2020 Alfresco Software. All rights reserved.