src/core/net/sf/basedb/util/bfs/InputStreamLocator.java

Code
Comments
Other
Rev Date Author Line
5224 27 Jan 10 nicklas 1 /**
5224 27 Jan 10 nicklas 2   $Id$
5224 27 Jan 10 nicklas 3
5224 27 Jan 10 nicklas 4   Copyright (C) 2009 Nicklas Nordborg
5224 27 Jan 10 nicklas 5
5224 27 Jan 10 nicklas 6   This file is part of BASE - BioArray Software Environment.
5224 27 Jan 10 nicklas 7   Available at http://base.thep.lu.se/
5224 27 Jan 10 nicklas 8
5224 27 Jan 10 nicklas 9   BASE is free software; you can redistribute it and/or
5224 27 Jan 10 nicklas 10   modify it under the terms of the GNU General Public License
5224 27 Jan 10 nicklas 11   as published by the Free Software Foundation; either version 3
5224 27 Jan 10 nicklas 12   of the License, or (at your option) any later version.
5224 27 Jan 10 nicklas 13
5224 27 Jan 10 nicklas 14   BASE is distributed in the hope that it will be useful,
5224 27 Jan 10 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5224 27 Jan 10 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5224 27 Jan 10 nicklas 17   GNU General Public License for more details.
5224 27 Jan 10 nicklas 18
5224 27 Jan 10 nicklas 19   You should have received a copy of the GNU General Public License
5224 27 Jan 10 nicklas 20   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 28   Defines a generic interface for opening an input stream from a named
5224 27 Jan 10 nicklas 29   resource. Implementations should know how to access a given resource
5224 27 Jan 10 nicklas 30   and create a stream that reads data from the resource.
5224 27 Jan 10 nicklas 31
5224 27 Jan 10 nicklas 32   @author Nicklas
5224 27 Jan 10 nicklas 33   @version 2.15
5224 27 Jan 10 nicklas 34   @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 40     Create an input stream that reads data from the given named
5224 27 Jan 10 nicklas 41     resource.
5224 27 Jan 10 nicklas 42     @param name The name (for example a file name) of the resource
5224 27 Jan 10 nicklas 43     @return An input stream
5224 27 Jan 10 nicklas 44     @throws IOException If there is any problem with locating or opening
5224 27 Jan 10 nicklas 45       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 51     Get the size in bytes of the given named resource.
5225 29 Jan 10 nicklas 52     @param name The name (for example a file name) of the resouce
5225 29 Jan 10 nicklas 53     @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 }