com.starla.smb
Class SMBFile

java.lang.Object
  |
  +--com.starla.smb.SMBFile
Direct Known Subclasses:
SMBCIFSFile, SMBCoreFile

public abstract class SMBFile
extends java.lang.Object

SMB file class.

This is an abstract class that defines the standard SMB file methods.


Field Summary
static int Closed
           
static int EndOfFile
          Various file state flags.
 
Method Summary
 boolean atEndOfFile()
          Check if the end of file has been reached.
 int Available()
          Return the number of bytes that are available for reading without blocking the input stream.
abstract  void Close()
          Close the remote file.
abstract  void Flush()
          Flush any buffered data for this file.
 java.lang.String getFileName()
          Get the file name string.
 java.lang.String getFilePath()
          Get the file path string.
 int getFileSize()
          Get the file size, in bytes.
 boolean isClosed()
          Check if the file has been closed.
 boolean isDirectory()
           
 boolean isHidden()
           
 boolean isReadOnly()
          Return the file attribute bit states.
 boolean isSystem()
           
abstract  int Read(byte[] buf, int siz, int offset)
          Read a block of data from the file.
 java.lang.String toString()
          Return the SMB file as a string
abstract  int Write(byte[] buf, int siz, int offset)
          Write a block of data to the file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EndOfFile

public static final int EndOfFile
Various file state flags.

Closed

public static final int Closed
Method Detail

atEndOfFile

public final boolean atEndOfFile()
Check if the end of file has been reached.
Returns:
true if end of file has been reached, else false.

Available

public final int Available()
Return the number of bytes that are available for reading without blocking the input stream.
Returns:
Number of bytes available for read without blocking the input stream.

Close

public abstract void Close()
                    throws java.io.IOException
Close the remote file.
Throws:
java.io.IOException - If an I/O error occurs

Flush

public abstract void Flush()
                    throws java.io.IOException
Flush any buffered data for this file.
Throws:
java.io.IOException - If an I/O error occurs

getFileName

public final java.lang.String getFileName()
Get the file name string.
Returns:
File name string.

getFilePath

public final java.lang.String getFilePath()
Get the file path string.
Returns:
File path string.

getFileSize

public final int getFileSize()
Get the file size, in bytes.
Returns:
File size in bytes.

isClosed

public final boolean isClosed()
Check if the file has been closed.
Returns:
true if the file has been closed, else false.

isDirectory

public final boolean isDirectory()

isHidden

public final boolean isHidden()

isReadOnly

public final boolean isReadOnly()
Return the file attribute bit states.

isSystem

public final boolean isSystem()

Read

public abstract int Read(byte[] buf,
                         int siz,
                         int offset)
                  throws java.io.IOException
Read a block of data from the file.
Parameters:
buf - Byte buffer to receive the data.
siz - Maximum length of data to receive.
offset - Offset within buffer to place received data.
Returns:
Actual length of data received.
Throws:
java.io.IOException - If an I/O error occurs

toString

public final java.lang.String toString()
Return the SMB file as a string
Returns:
SMB file string.
Overrides:
toString in class java.lang.Object

Write

public abstract int Write(byte[] buf,
                          int siz,
                          int offset)
                   throws java.io.IOException
Write a block of data to the file.
Parameters:
buf - Byte buffer containing data to be written.
siz - Length of data to be written.
offset - Offset within buffer to start writing data from.
Returns:
Actual length of data written.
Throws:
java.io.IOException - If an I/O error occurs