Your browser does not allow storing cookies. We recommend enabling them.


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()
           
 InputStreamopenInput()
          Opens this file and returns an InputStream for reading from the file.
 OutputStreamopenOutput()
           
 InputStreamopenRawInput()
          Opens this file and returns an unbuffered InputStream for reading from this file.
 OutputStreamopenRawOutput()
           
 
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



 

 
PrivX
 

 

 
What to read next:

  • Reduce Secure Shell risk. Get to know the NIST 7966.



    The NISTIR 7966 guideline from the Computer Security Division of NIST is a direct call to action for organizations regardless of industry and is a mandate for the US Federal government.
    Download now
  • ISACA Practitioner Guide for SSH



    With contributions from practitioners, specialists and SSH.COM experts, the ISACA “SSH: Practitioner Considerations” guide is vital best practice from the compliance and audit community.
    Download now