src/core/net/sf/basedb/util/importer/FileWrapper.java

Code
Comments
Other
Rev Date Author Line
5374 03 Aug 10 nicklas 1 /**
5374 03 Aug 10 nicklas 2   $Id$
5374 03 Aug 10 nicklas 3
5374 03 Aug 10 nicklas 4   Copyright (C) 2010 Nicklas Nordborg
5374 03 Aug 10 nicklas 5
5374 03 Aug 10 nicklas 6   This file is part of BASE - BioArray Software Environment.
5374 03 Aug 10 nicklas 7   Available at http://base.thep.lu.se/
5374 03 Aug 10 nicklas 8
5374 03 Aug 10 nicklas 9   BASE is free software; you can redistribute it and/or
5374 03 Aug 10 nicklas 10   modify it under the terms of the GNU General Public License
5374 03 Aug 10 nicklas 11   as published by the Free Software Foundation; either version 3
5374 03 Aug 10 nicklas 12   of the License, or (at your option) any later version.
5374 03 Aug 10 nicklas 13
5374 03 Aug 10 nicklas 14   BASE is distributed in the hope that it will be useful,
5374 03 Aug 10 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5374 03 Aug 10 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5374 03 Aug 10 nicklas 17   GNU General Public License for more details.
5374 03 Aug 10 nicklas 18
5374 03 Aug 10 nicklas 19   You should have received a copy of the GNU General Public License
5374 03 Aug 10 nicklas 20   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 28   Wrapper around files that provide some basic information about the file.
5374 03 Aug 10 nicklas 29   This allows us to work with both files on disk and in the BASE file system
5374 03 Aug 10 nicklas 30   without handling special cases.
5374 03 Aug 10 nicklas 31
5374 03 Aug 10 nicklas 32   @author Nicklas
5374 03 Aug 10 nicklas 33   @since 2.16
5374 03 Aug 10 nicklas 34   @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 40     Get the name of the file.
5374 03 Aug 10 nicklas 41     @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 46     Get the size of the file.
5374 03 Aug 10 nicklas 47     @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 52     Get the character set used in the file.
5374 03 Aug 10 nicklas 53     @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 58     Get an input stream that reads data from the file.
5374 03 Aug 10 nicklas 59     Multiple calls to this method should normally result in
5374 03 Aug 10 nicklas 60     multiple independent streams.
5374 03 Aug 10 nicklas 61     @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 }