Package net.sf.basedb.util.importer
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) $
-
-
Constructor Summary
Constructors Constructor Description DiskFileWrapper(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCharacterSet()
Get the character set used in the file.InputStream
getInputStream()
Get an input stream that reads data from the file.String
getName()
Get the name of the file.long
getSize()
Get the size of the file.
-
-
-
Field Detail
-
file
private final File file
-
-
Constructor Detail
-
DiskFileWrapper
public DiskFileWrapper(File file)
-
-
Method Detail
-
getCharacterSet
public String getCharacterSet()
Description copied from interface:FileWrapper
Get the character set used in the file.- Specified by:
getCharacterSet
in interfaceFileWrapper
- 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 interfaceFileWrapper
- 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 interfaceFileWrapper
- 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 interfaceFileWrapper
- Returns:
- The size of the file, or -1 if not known
-
-