Class DiskFileWrapper

java.lang.Object
net.sf.basedb.util.importer.DiskFileWrapper
All Implemented Interfaces:
FileWrapper

public class DiskFileWrapper
extends Object
implements FileWrapper
File wrapper implementation for files that are located on the local disk.
Since:
2.16
Author:
Nicklas
Last modified
$Date: 2010-08-03 11:21:30 +0200 (ti, 03 aug 2010) $
  • Field Details

    • file

      private final File file
  • Constructor Details

    • DiskFileWrapper

      public DiskFileWrapper​(File file)
  • Method Details

    • getCharacterSet

      public String getCharacterSet()
      Description copied from interface: FileWrapper
      Get the character set used in the file.
      Specified by:
      getCharacterSet in interface FileWrapper
      Returns:
      The character set, or null if not known or if the file is binary file
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from interface: FileWrapper
      Get an input stream that reads data from the file. Multiple calls to this method should normally result in multiple independent streams.
      Specified by:
      getInputStream in interface FileWrapper
      Returns:
      An input stream
      Throws:
      IOException
    • getName

      public String getName()
      Description copied from interface: FileWrapper
      Get the name of the file.
      Specified by:
      getName in interface FileWrapper
      Returns:
      The name of the file, or null if not known
    • getSize

      public long getSize()
      Description copied from interface: FileWrapper
      Get the size of the file.
      Specified by:
      getSize in interface FileWrapper
      Returns:
      The size of the file, or -1 if not known