public class JavaFileDiskDriver extends java.lang.Object implements DiskInterface
| Modifier and Type | Field and Description |
|---|---|
protected static long |
_globalCreateDate |
| Constructor and Description |
|---|
JavaFileDiskDriver()
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected FileInfo |
buildFileInformation(java.lang.String path,
java.lang.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(java.lang.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,
java.lang.String dir)
Delete a directory
|
void |
deleteFile(SrvSession sess,
TreeConnection tree,
java.lang.String name)
Delete a file
|
int |
fileExists(SrvSession sess,
TreeConnection tree,
java.lang.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,
java.lang.String name)
Return file information about the specified file
|
static long |
getGlobalCreateDateTime()
Return the global file creation date/time
|
boolean |
isReadOnly(SrvSession sess,
DeviceContext ctx)
Determine if the disk device is read-only.
|
protected java.lang.String |
mapPath(java.lang.String path)
Map the input path to a real path, this may require changing the case of various parts of the
path.
|
protected java.lang.String |
mapPath(java.lang.String base,
java.lang.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,
java.lang.String oldName,
java.lang.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,
java.lang.String name,
FileInfo info)
Set file information
|
SearchContext |
startSearch(SrvSession sess,
TreeConnection tree,
java.lang.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(java.lang.String path, java.lang.String relPath)
path - StringrelPath - Stringpublic void closeFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws java.io.IOException
closeFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network file detailsjava.io.IOExceptionpublic void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params) throws java.io.IOException
createDirectory in interface DiskInterfacesess - Session detailstree - Tree connectionparams - Directory parametersjava.io.IOExceptionpublic NetworkFile createFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws java.io.IOException
createFile in interface DiskInterfacesess - Session detailstree - Tree connectionparams - File open parametersjava.io.IOExceptionpublic void deleteDirectory(SrvSession sess, TreeConnection tree, java.lang.String dir) throws java.io.IOException
deleteDirectory in interface DiskInterfacesess - Session detailstree - Tree connectiondir - Path of directory to deletejava.io.IOExceptionpublic void deleteFile(SrvSession sess, TreeConnection tree, java.lang.String name) throws java.io.IOException
deleteFile in interface DiskInterfacesess - Session detailstree - Tree connectionname - Name of file to deletejava.io.IOExceptionpublic int fileExists(SrvSession sess, TreeConnection tree, java.lang.String name)
fileExists in interface DiskInterfacesess - Session detailstree - Tree connectionname - File nameFileStatuspublic void flushFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws java.io.IOException
flushFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network filejava.io.IOExceptionpublic FileInfo getFileInformation(SrvSession sess, TreeConnection tree, java.lang.String name) throws java.io.IOException
getFileInformation in interface DiskInterfacesess - Session detailstree - Tree connectionname - File namejava.io.IOExceptionpublic boolean isReadOnly(SrvSession sess, DeviceContext ctx) throws java.io.IOException
isReadOnly in interface DiskInterfacesess - Session detailsctx - Device contextjava.io.IOException - If an error occurs.protected final java.lang.String mapPath(java.lang.String path)
throws java.io.FileNotFoundException,
PathNotFoundException
path - Share relative pathjava.io.FileNotFoundExceptionPathNotFoundExceptionprotected final java.lang.String mapPath(java.lang.String base,
java.lang.String path)
throws java.io.FileNotFoundException,
PathNotFoundException
base - java.lang.Stringpath - java.lang.Stringjava.io.FileNotFoundException - 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 java.io.IOException
openFile in interface DiskInterfacesess - Session detailstree - Tree connectionparams - File open parametersjava.io.IOExceptionpublic int readFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufPos, int siz, long filePos) throws java.io.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 datajava.io.IOExceptionpublic void renameFile(SrvSession sess, TreeConnection tree, java.lang.String oldName, java.lang.String newName) throws java.io.IOException
renameFile in interface DiskInterfacesess - Session detailstree - Tree connectionoldName - Existing file namenewName - New file namejava.io.IOExceptionpublic long seekFile(SrvSession sess, TreeConnection tree, NetworkFile file, long pos, int typ) throws java.io.IOException
seekFile in interface DiskInterfacesess - Session detailstree - Tree connectionfile - Network filepos - New file positiontyp - Seek typejava.io.IOExceptionpublic void setFileInformation(SrvSession sess, TreeConnection tree, java.lang.String name, FileInfo info) throws java.io.IOException
setFileInformation in interface DiskInterfacesess - Session detailstree - Tree connectionname - File nameinfo - File information to be setjava.io.IOExceptionpublic SearchContext startSearch(SrvSession sess, TreeConnection tree, java.lang.String searchPath, int attrib) throws java.io.FileNotFoundException
startSearch in interface DiskInterfacesess - Session detailstree - Tree connectionsearchPath - Search path, may include wildcardsattrib - Search attributesjava.io.FileNotFoundExceptionpublic void truncateFile(SrvSession sess, TreeConnection tree, NetworkFile file, long siz) throws java.io.IOException
truncateFile in interface DiskInterfacesess - Server sessiontree - Tree connectionfile - Network file detailssiz - New file lengthjava.io.IOException - The exception description.public int writeFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufoff, int siz, long fileoff) throws java.io.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 datajava.io.IOException - The exception description.public DeviceContext createContext(java.lang.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()
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.