src/core/net/sf/basedb/util/uri/ResumableConnectionManager.java

Code
Comments
Other
Rev Date Author Line
6493 25 Jun 14 nicklas 1 /**
6493 25 Jun 14 nicklas 2   $Id$
6493 25 Jun 14 nicklas 3
6493 25 Jun 14 nicklas 4   Copyright (C) 2014 Nicklas Nordborg
6493 25 Jun 14 nicklas 5
6493 25 Jun 14 nicklas 6   This file is part of BASE - BioArray Software Environment.
6493 25 Jun 14 nicklas 7   Available at http://base.thep.lu.se/
6493 25 Jun 14 nicklas 8
6493 25 Jun 14 nicklas 9   BASE is free software; you can redistribute it and/or
6493 25 Jun 14 nicklas 10   modify it under the terms of the GNU General Public License
6493 25 Jun 14 nicklas 11   as published by the Free Software Foundation; either version 3
6493 25 Jun 14 nicklas 12   of the License, or (at your option) any later version.
6493 25 Jun 14 nicklas 13
6493 25 Jun 14 nicklas 14   BASE is distributed in the hope that it will be useful,
6493 25 Jun 14 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
6493 25 Jun 14 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6493 25 Jun 14 nicklas 17   GNU General Public License for more details.
6493 25 Jun 14 nicklas 18
6493 25 Jun 14 nicklas 19   You should have received a copy of the GNU General Public License
6493 25 Jun 14 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
6493 25 Jun 14 nicklas 21 */
6493 25 Jun 14 nicklas 22 package net.sf.basedb.util.uri;
6493 25 Jun 14 nicklas 23
6493 25 Jun 14 nicklas 24 import java.io.IOException;
6493 25 Jun 14 nicklas 25 import java.io.InputStream;
6493 25 Jun 14 nicklas 26
6493 25 Jun 14 nicklas 27 /**
6493 25 Jun 14 nicklas 28   An extension to the {@link ConnectionManager} interface that
6493 25 Jun 14 nicklas 29   add support for specifying a start offset when downloading the
6493 25 Jun 14 nicklas 30   external file. If the external protocol has support for setting
6493 25 Jun 14 nicklas 31   a start offset it is recommended that connection managers are
6493 25 Jun 14 nicklas 32   implementing this interface, since otherwise the BASE core may
6493 25 Jun 14 nicklas 33   simply read to the specified offset which is wasting bandwith.
6493 25 Jun 14 nicklas 34
6493 25 Jun 14 nicklas 35   @author Nicklas
6493 25 Jun 14 nicklas 36   @since 3.3
6493 25 Jun 14 nicklas 37 */
6493 25 Jun 14 nicklas 38 public interface ResumableConnectionManager
6493 25 Jun 14 nicklas 39   extends ConnectionManager
6493 25 Jun 14 nicklas 40 {
6493 25 Jun 14 nicklas 41
6493 25 Jun 14 nicklas 42   /**
6493 25 Jun 14 nicklas 43     Get an InputStream for reading the contents of the resource.
6493 25 Jun 14 nicklas 44     @param offset The offset to start reading from
6493 25 Jun 14 nicklas 45     @return An InputStream object, or null if the no data is available
6493 25 Jun 14 nicklas 46     @throws IOException If there is an error creating the stream
6493 25 Jun 14 nicklas 47   */
6493 25 Jun 14 nicklas 48   public InputStream getInputStream(long offset)
6493 25 Jun 14 nicklas 49     throws IOException;
6493 25 Jun 14 nicklas 50   
6493 25 Jun 14 nicklas 51 }
6493 25 Jun 14 nicklas 52