public final class CIFSFile extends SMBFile
An SMB file provides read and/or write access to a remote file.
A CIFSFile is created via an DiskSession object, using the DiskSession.OpenFile() method. A CIFSFile may also be created via the CIFSDiskSession.NTCreate() method if the NT SMB dialect has been negotiated. The NTCreate() method provides access to more features on an NTFS filesystem.
A remote file may also be opened as an InputStream or OutputStream using the DiskSession.OpenInputStream () and DiskSession.OpenOutputStream () methods.
Modifier | Constructor and Description |
---|---|
protected |
CIFSFile(Session sess,
FileInfo finfo,
int fid)
Class constructor
|
protected |
CIFSFile(Session sess,
FileInfo finfo,
int fid,
int oplockTyp)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
Close(SMBDate wrDateTime)
Close the remote file.
|
void |
Flush()
Flush data to the remote file.
|
protected OplockInterface |
getOplockInterface()
Return the oplock interface
|
int |
getOplockType()
Check if the file has an associated oplock
|
protected boolean |
isNTDialect()
Check if NT dialect SMBs should be used
|
boolean |
isReparsePoint()
Check if the file is a repars point
|
void |
Lock(long offset,
long len)
Lock a range of bytes within the file
|
int |
Read(byte[] buf,
int siz,
int offset)
Read a block of data from the file.
|
long |
Seek(long pos,
int typ)
Seek to the specified point in the file.
|
protected void |
setOplockInterface(OplockInterface oplockIface)
Set the oplock interface
|
protected void |
setOplockType(int oplockTyp)
Set the oplock type
|
void |
Unlock(long offset,
long len)
Unlock a range of bytes within the file
|
int |
Write(byte[] buf,
int siz,
int offset)
Write a block of data to the file.
|
asInputStream, asOutputStream, atEndOfFile, Available, clearEndOfFile, Close, finalize, getAttributes, getFileId, getFileName, getFilePath, getFileSize, getReadPosition, getSession, getWritePosition, hasStateFlag, isClosed, isDirectory, isHidden, isReadOnly, isSystem, Read, refreshFileInformation, setFileInformation, setStateFlag, toString, Write, Write
protected CIFSFile(Session sess, FileInfo finfo, int fid)
sess
- Session that this file is associated withfinfo
- File information for the new filefid
- File identifier for this filepublic final void Close(SMBDate wrDateTime) throws IOException, SMBException
Close
in class SMBFile
wrDateTime
- Set the last write date/time, or null to let the server set the date/timeIOException
- If an I/O error occursSMBException
- If an SMB level error occurspublic final void Flush() throws IOException, SMBException
Flush
in class SMBFile
IOException
- If an I/O error occursSMBException
- If an SMB level error occurspublic final int Read(byte[] buf, int siz, int offset) throws IOException, SMBException
Read
in class SMBFile
buf
- Byte buffer to receive the data.siz
- Maximum length of data to receive.offset
- Offset within buffer to place received data.IOException
- If an I/O error occursSMBException
- If an SMB level error occurspublic final int Write(byte[] buf, int siz, int offset) throws IOException, SMBException
Write
in class SMBFile
buf
- Byte buffer containing data to be written.siz
- Length of data to be written.offset
- Offset within buffer to start writing data from.IOException
- If an I/O error occursSMBException
- If an SMB level error occurspublic long Seek(long pos, int typ) throws IOException, SMBException
Seek
in class SMBFile
pos
- Relative offsettyp
- Seek type (@see org.alfresco.jlan.smb.SeekType)IOException
SMBException
- If an SMB level error occurspublic void Lock(long offset, long len) throws IOException, SMBException
Lock
in class SMBFile
offset
- Offset within the file to start locklen
- Number of bytes to lockIOException
SMBException
- If an SMB level error occurspublic void Unlock(long offset, long len) throws IOException, SMBException
Unlock
in class SMBFile
offset
- Offset within the file to unlocklen
- Number of bytes to unlockIOException
SMBException
- If an SMB level error occursprotected final boolean isNTDialect()
public final boolean isReparsePoint()
public final int getOplockType()
protected void setOplockType(int oplockTyp)
oplockTyp
- intprotected void setOplockInterface(OplockInterface oplockIface)
oplockIface
- OplockInterfaceprotected OplockInterface getOplockInterface()
Copyright © 2005–2017 Alfresco Software. All rights reserved.