public interface DiskInterface extends DeviceInterface
Modifier and Type | Method and Description |
---|---|
void |
closeFile(SrvSession sess,
TreeConnection tree,
NetworkFile param)
Close the file.
|
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.
|
void |
flushFile(SrvSession sess,
TreeConnection tree,
NetworkFile file)
Flush any buffered output for the specified file.
|
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 |
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 |
setFileInformation(SrvSession sess,
TreeConnection tree,
String name,
FileInfo info)
Set the file information for the specified file.
|
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 |
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.
|
createContext, treeClosed, treeOpened
void closeFile(SrvSession sess, TreeConnection tree, NetworkFile param) throws IOException
sess
- Server sessiontree
- Tree connection.param
- Network file context.IOException
- If an error occurs.void createDirectory(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
sess
- Server sessiontree
- Tree connection.params
- Directory create parametersIOException
- If an error occurs.NetworkFile createFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
sess
- Server sessiontree
- Tree connectionparams
- File create parametersIOException
- If an error occurs.void deleteDirectory(SrvSession sess, TreeConnection tree, String dir) throws IOException
sess
- Server sessiontree
- Tree connectiondir
- Directory name.IOException
- The exception description.void deleteFile(SrvSession sess, TreeConnection tree, String name) throws IOException
sess
- Server sessiontree
- Tree connectionname
- File nameIOException
- The exception description.int fileExists(SrvSession sess, TreeConnection tree, String name)
sess
- Server sessiontree
- Tree connectionname
- java.lang.StringFileStatus
void flushFile(SrvSession sess, TreeConnection tree, NetworkFile file) throws IOException
sess
- Server sessiontree
- Tree connectionfile
- Network file context.IOException
- The exception description.FileInfo getFileInformation(SrvSession sess, TreeConnection tree, String name) throws IOException
sess
- Server sessiontree
- Tree connectionname
- File name/path that information is required for.IOException
- The exception description.boolean isReadOnly(SrvSession sess, DeviceContext ctx) throws IOException
sess
- Server sessionctx
- Device contextIOException
- If an error occurs.NetworkFile openFile(SrvSession sess, TreeConnection tree, FileOpenParams params) throws IOException
sess
- Server sessiontree
- Tree connectionparams
- File open parametersIOException
- If an error occurs.int readFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufPos, int siz, long filePos) throws IOException
sess
- 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.void renameFile(SrvSession sess, TreeConnection tree, String oldName, String newName) throws IOException
sess
- Server sessiontree
- Tree connectionoldName
- java.lang.StringnewName
- java.lang.StringIOException
- The exception description.long seekFile(SrvSession sess, TreeConnection tree, NetworkFile file, long pos, int typ) throws IOException
sess
- Server sessiontree
- Tree connectionfile
- Network file.pos
- Position to seek to.typ
- Seek type.IOException
void setFileInformation(SrvSession sess, TreeConnection tree, String name, FileInfo info) throws IOException
sess
- Server sessiontree
- Tree connectionname
- java.lang.Stringinfo
- FileInfoIOException
- The exception description.SearchContext startSearch(SrvSession sess, TreeConnection tree, String searchPath, int attrib) throws FileNotFoundException
sess
- 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.void truncateFile(SrvSession sess, TreeConnection tree, NetworkFile file, long siz) throws IOException
sess
- Server sessiontree
- Tree connectionfile
- Network file detailssiz
- New file lengthIOException
- The exception description.int writeFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufoff, int siz, long fileoff) throws IOException
sess
- 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.Copyright © 2005–2017 Alfresco Software. All rights reserved.