Class FilenameFileRegion

java.lang.Object
org.apache.mina.core.file.DefaultFileRegion
org.apache.mina.core.file.FilenameFileRegion
All Implemented Interfaces:
FileRegion

public class FilenameFileRegion extends DefaultFileRegion
Manage a File to be sent to a remote host. We keep a track on the current position, and the number of already written bytes.
Version:
$Rev$, $Date$
  • Field Details

    • file

      private final File file
  • Constructor Details

    • FilenameFileRegion

      public FilenameFileRegion(File file, FileChannel channel)
      Create a new FilenameFileRegion instance
      Parameters:
      file - The file to manage
      channel - The channel over the file
    • FilenameFileRegion

      public FilenameFileRegion(File file, FileChannel channel, long position, long remainingBytes)
      Create a new FilenameFileRegion instance
      Parameters:
      file - The file to manage
      channel - The channel over the file
      position - The position in teh file
      remainingBytes - The remaining bytes
  • Method Details

    • getFilename

      public String getFilename()
      Provides an absolute filename for the underlying FileChannel.
      Specified by:
      getFilename in interface FileRegion
      Overrides:
      getFilename in class DefaultFileRegion
      Returns:
      the absolute filename, or null if the FileRegion does not know the filename