Class FileTransfer

java.lang.Object
org.glassfish.grizzly.FileTransfer
All Implemented Interfaces:
WritableMessage, FileChunk

public class FileTransfer extends Object implements FileChunk
Since:
2.2
  • Constructor Details

    • FileTransfer

      public FileTransfer(File f)
      Constructs a new FileTransfer instance backed by the specified File. This simply calls this(f, 0, f.length).
      Parameters:
      f - the File to transfer.
      Throws:
      NullPointerException - if f is null.
      See Also:
    • FileTransfer

      public FileTransfer(File f, long pos, long len)
      Constructs a new FileTransfer instance backed by the specified File. The content to transfer will begin at the specified offset, pos with the total transfer length being specified by len.
      Parameters:
      f - the File to transfer.
      pos - the offset within the File to start the transfer.
      len - the total number of bytes to transfer.
      Throws:
      IllegalArgumentException - if f is null, does not exist, is not readable, or is a directory.
      IllegalArgumentException - if pos or len are negative.
      IllegalArgumentException - if len exceeds the number of bytes that may be transferred based on the provided offset and file length.
  • Method Details