5374 |
03 Aug 10 |
nicklas |
1 |
/** |
5374 |
03 Aug 10 |
nicklas |
$Id$ |
5374 |
03 Aug 10 |
nicklas |
3 |
|
5374 |
03 Aug 10 |
nicklas |
Copyright (C) 2010 Nicklas Nordborg |
5374 |
03 Aug 10 |
nicklas |
5 |
|
5374 |
03 Aug 10 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5374 |
03 Aug 10 |
nicklas |
Available at http://base.thep.lu.se/ |
5374 |
03 Aug 10 |
nicklas |
8 |
|
5374 |
03 Aug 10 |
nicklas |
BASE is free software; you can redistribute it and/or |
5374 |
03 Aug 10 |
nicklas |
modify it under the terms of the GNU General Public License |
5374 |
03 Aug 10 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5374 |
03 Aug 10 |
nicklas |
of the License, or (at your option) any later version. |
5374 |
03 Aug 10 |
nicklas |
13 |
|
5374 |
03 Aug 10 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5374 |
03 Aug 10 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5374 |
03 Aug 10 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5374 |
03 Aug 10 |
nicklas |
GNU General Public License for more details. |
5374 |
03 Aug 10 |
nicklas |
18 |
|
5374 |
03 Aug 10 |
nicklas |
You should have received a copy of the GNU General Public License |
5374 |
03 Aug 10 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5374 |
03 Aug 10 |
nicklas |
21 |
*/ |
5374 |
03 Aug 10 |
nicklas |
22 |
package net.sf.basedb.util.importer; |
5374 |
03 Aug 10 |
nicklas |
23 |
|
5374 |
03 Aug 10 |
nicklas |
24 |
import java.io.IOException; |
5374 |
03 Aug 10 |
nicklas |
25 |
import java.io.InputStream; |
5374 |
03 Aug 10 |
nicklas |
26 |
|
5374 |
03 Aug 10 |
nicklas |
27 |
/** |
5374 |
03 Aug 10 |
nicklas |
Wrapper around files that provide some basic information about the file. |
5374 |
03 Aug 10 |
nicklas |
This allows us to work with both files on disk and in the BASE file system |
5374 |
03 Aug 10 |
nicklas |
without handling special cases. |
5374 |
03 Aug 10 |
nicklas |
31 |
|
5374 |
03 Aug 10 |
nicklas |
@author Nicklas |
5374 |
03 Aug 10 |
nicklas |
@since 2.16 |
5374 |
03 Aug 10 |
nicklas |
@base.modified $Date$ |
5374 |
03 Aug 10 |
nicklas |
35 |
*/ |
5374 |
03 Aug 10 |
nicklas |
36 |
public interface FileWrapper |
5374 |
03 Aug 10 |
nicklas |
37 |
{ |
5374 |
03 Aug 10 |
nicklas |
38 |
|
5374 |
03 Aug 10 |
nicklas |
39 |
/** |
5374 |
03 Aug 10 |
nicklas |
Get the name of the file. |
5374 |
03 Aug 10 |
nicklas |
@return The name of the file, or null if not known |
5374 |
03 Aug 10 |
nicklas |
42 |
*/ |
5374 |
03 Aug 10 |
nicklas |
43 |
public String getName(); |
5374 |
03 Aug 10 |
nicklas |
44 |
|
5374 |
03 Aug 10 |
nicklas |
45 |
/** |
5374 |
03 Aug 10 |
nicklas |
Get the size of the file. |
5374 |
03 Aug 10 |
nicklas |
@return The size of the file, or -1 if not known |
5374 |
03 Aug 10 |
nicklas |
48 |
*/ |
5374 |
03 Aug 10 |
nicklas |
49 |
public long getSize(); |
5374 |
03 Aug 10 |
nicklas |
50 |
|
5374 |
03 Aug 10 |
nicklas |
51 |
/** |
5374 |
03 Aug 10 |
nicklas |
Get the character set used in the file. |
5374 |
03 Aug 10 |
nicklas |
@return The character set, or null if not known or if the file is binary file |
5374 |
03 Aug 10 |
nicklas |
54 |
*/ |
5374 |
03 Aug 10 |
nicklas |
55 |
public String getCharacterSet(); |
5374 |
03 Aug 10 |
nicklas |
56 |
|
5374 |
03 Aug 10 |
nicklas |
57 |
/** |
5374 |
03 Aug 10 |
nicklas |
Get an input stream that reads data from the file. |
5374 |
03 Aug 10 |
nicklas |
Multiple calls to this method should normally result in |
5374 |
03 Aug 10 |
nicklas |
multiple independent streams. |
5374 |
03 Aug 10 |
nicklas |
@return An input stream |
5374 |
03 Aug 10 |
nicklas |
62 |
*/ |
5374 |
03 Aug 10 |
nicklas |
63 |
public InputStream getInputStream() |
5374 |
03 Aug 10 |
nicklas |
64 |
throws IOException; |
5374 |
03 Aug 10 |
nicklas |
65 |
|
5374 |
03 Aug 10 |
nicklas |
66 |
} |