5224 |
27 Jan 10 |
nicklas |
1 |
/** |
5224 |
27 Jan 10 |
nicklas |
$Id$ |
5224 |
27 Jan 10 |
nicklas |
3 |
|
5224 |
27 Jan 10 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
5224 |
27 Jan 10 |
nicklas |
5 |
|
5224 |
27 Jan 10 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5224 |
27 Jan 10 |
nicklas |
Available at http://base.thep.lu.se/ |
5224 |
27 Jan 10 |
nicklas |
8 |
|
5224 |
27 Jan 10 |
nicklas |
BASE is free software; you can redistribute it and/or |
5224 |
27 Jan 10 |
nicklas |
modify it under the terms of the GNU General Public License |
5224 |
27 Jan 10 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5224 |
27 Jan 10 |
nicklas |
of the License, or (at your option) any later version. |
5224 |
27 Jan 10 |
nicklas |
13 |
|
5224 |
27 Jan 10 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5224 |
27 Jan 10 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5224 |
27 Jan 10 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5224 |
27 Jan 10 |
nicklas |
GNU General Public License for more details. |
5224 |
27 Jan 10 |
nicklas |
18 |
|
5224 |
27 Jan 10 |
nicklas |
You should have received a copy of the GNU General Public License |
5224 |
27 Jan 10 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5224 |
27 Jan 10 |
nicklas |
21 |
*/ |
5224 |
27 Jan 10 |
nicklas |
22 |
package net.sf.basedb.util.bfs; |
5224 |
27 Jan 10 |
nicklas |
23 |
|
5224 |
27 Jan 10 |
nicklas |
24 |
import java.io.IOException; |
5224 |
27 Jan 10 |
nicklas |
25 |
import java.io.InputStream; |
5224 |
27 Jan 10 |
nicklas |
26 |
|
5224 |
27 Jan 10 |
nicklas |
27 |
/** |
5224 |
27 Jan 10 |
nicklas |
Defines a generic interface for opening an input stream from a named |
5224 |
27 Jan 10 |
nicklas |
resource. Implementations should know how to access a given resource |
5224 |
27 Jan 10 |
nicklas |
and create a stream that reads data from the resource. |
5224 |
27 Jan 10 |
nicklas |
31 |
|
5224 |
27 Jan 10 |
nicklas |
@author Nicklas |
5224 |
27 Jan 10 |
nicklas |
@version 2.15 |
5224 |
27 Jan 10 |
nicklas |
@base.modified $Date$ |
5224 |
27 Jan 10 |
nicklas |
35 |
*/ |
5224 |
27 Jan 10 |
nicklas |
36 |
public interface InputStreamLocator |
5224 |
27 Jan 10 |
nicklas |
37 |
{ |
5224 |
27 Jan 10 |
nicklas |
38 |
|
5224 |
27 Jan 10 |
nicklas |
39 |
/** |
5224 |
27 Jan 10 |
nicklas |
Create an input stream that reads data from the given named |
5224 |
27 Jan 10 |
nicklas |
resource. |
5224 |
27 Jan 10 |
nicklas |
@param name The name (for example a file name) of the resource |
5224 |
27 Jan 10 |
nicklas |
@return An input stream |
5224 |
27 Jan 10 |
nicklas |
@throws IOException If there is any problem with locating or opening |
5224 |
27 Jan 10 |
nicklas |
the resource |
5224 |
27 Jan 10 |
nicklas |
46 |
*/ |
5224 |
27 Jan 10 |
nicklas |
47 |
public InputStream getInputStream(String name) |
5224 |
27 Jan 10 |
nicklas |
48 |
throws IOException; |
5225 |
29 Jan 10 |
nicklas |
49 |
|
5225 |
29 Jan 10 |
nicklas |
50 |
/** |
5225 |
29 Jan 10 |
nicklas |
Get the size in bytes of the given named resource. |
5225 |
29 Jan 10 |
nicklas |
@param name The name (for example a file name) of the resouce |
5225 |
29 Jan 10 |
nicklas |
@return The size in bytes, or -1 if not known |
5225 |
29 Jan 10 |
nicklas |
54 |
*/ |
5225 |
29 Jan 10 |
nicklas |
55 |
public long getSize(String name); |
5224 |
27 Jan 10 |
nicklas |
56 |
} |