2.17.2: 2011-06-17

net.sf.basedb.util.importer
Class BaseFileWrapper

java.lang.Object
  extended by net.sf.basedb.util.importer.BaseFileWrapper
All Implemented Interfaces:
FileWrapper

public class BaseFileWrapper
extends Object
implements FileWrapper

File wrapper implementation for files that are located on the BASE file system.

Since:
2.16
Author:
Nicklas
Last modified
$Date: 2010-08-03 11:21:30 +0200 (Tue, 03 Aug 2010) $

Field Summary
private  File file
           
 
Constructor Summary
BaseFileWrapper(File file)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private final File file
Constructor Detail

BaseFileWrapper

public BaseFileWrapper(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 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

2.17.2: 2011-06-17