com.ssh.sft
Class RegularFile

java.lang.Object
  extended bycom.ssh.sft.SftLib
      extended bycom.ssh.sft.SftBase
          extended bycom.ssh.sft.File
              extended bycom.ssh.sft.RegularFile
All Implemented Interfaces:
com.ssh.sft.SftLibConstants, com.ssh.sft.SshSftFileType

public class RegularFile
extends File

A regular file. Regular files are files that contain binary data.


Field Summary
 
Fields inherited from class com.ssh.sft.File
SSH_SFT_DIR_RECURSIVE, SSH_SFT_FILE_TYPE_DIRECTORY, SSH_SFT_FILE_TYPE_REGULAR, SSH_SFT_FILE_TYPE_SPECIAL, SSH_SFT_FILE_TYPE_SYMLINK, SSH_SFT_FILE_TYPE_UNKNOWN, SSH_SFT_HASH_MAX_BLOCK_SIZE, SSH_SFT_HASH_MAX_ITERATIONS, SSH_SFT_HASH_MIN_BLOCK_SIZE, SSH_SFT_REQUEST_MAX_NUM, SSH_SFT_REQUEST_MAX_SIZE
 
Constructor Summary
RegularFile()
           
 
Method Summary
 byte[] computeHash(String hashName, long offset, long len)
           
 byte[] computeMD5()
           
 InputStream openInput()
          Opens this file and returns an InputStream for reading from the file.
 OutputStream openOutput()
           
 InputStream openRawInput()
          Opens this file and returns an unbuffered InputStream for reading from this file.
 OutputStream openRawOutput()
           
 
Methods inherited from class com.ssh.sft.File
copy, copy, getAttributes, getGroup, getLocation, getOwner, getPath, getSession, getSize, getURI, move, remove, rename, setAttributes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularFile

public RegularFile()
Method Detail

openInput

public InputStream openInput()
                      throws SftException
Opens this file and returns an InputStream for reading from the file.

Returns:
a stream for reading from this file
Throws:
SftException

openRawInput

public InputStream openRawInput()
                         throws SftException
Opens this file and returns an unbuffered InputStream for reading from this file. This method differs from openInput() only in the fact that the returned stream is unbuffered: every call to InputStream.read() involves a separate network request to the remote SFTP server.

Returns:
an unbuffered stream for reading from this file
Throws:
SftException

openRawOutput

public OutputStream openRawOutput()
                           throws SftException
Throws:
SftException

openOutput

public OutputStream openOutput()
                        throws SftException
Throws:
SftException

computeHash

public byte[] computeHash(String hashName,
                          long offset,
                          long len)
                   throws SftException
Throws:
SftException

computeMD5

public byte[] computeMD5()
                  throws SftException
Throws:
SftException