uk.ac.starlink.srb
Class GeneralFileDataSource

java.lang.Object
  extended by uk.ac.starlink.util.DataSource
      extended by uk.ac.starlink.srb.GeneralFileDataSource

public class GeneralFileDataSource
extends DataSource

DataSource implementation based on a JARGON GeneralFile object.

Since:
7 Mar 2005
Author:
Mark Taylor (Starlink)

Field Summary
 
Fields inherited from class uk.ac.starlink.util.DataSource
DEFAULT_INTRO_LIMIT, MARK_WORKAROUND_PROPERTY
 
Constructor Summary
GeneralFileDataSource(edu.sdsc.grid.io.GeneralFile gf)
          Constructor.
 
Method Summary
 String getName()
          Returns a name for this source.
 InputStream getRawInputStream()
          Provides a new InputStream for this data source.
 
Methods inherited from class uk.ac.starlink.util.DataSource
close, forceCompression, getCompression, getHybridInputStream, getInputStream, getInputStream, getIntro, getIntroLimit, getLength, getMarkWorkaround, getPosition, getRawLength, getSystemId, getURL, makeDataSource, makeDataSource, setCompression, setIntroLimit, setMarkWorkaround, setName, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeneralFileDataSource

public GeneralFileDataSource(edu.sdsc.grid.io.GeneralFile gf)
Constructor.

Parameters:
gf - general file object on which this DataSource is based.
Method Detail

getName

public String getName()
Description copied from class: DataSource
Returns a name for this source. This name is mainly intended as a label identifying the source for use in informational messages; it is not in general intended to be used to provide an absolute reference to the source. Thus, for instance, if the source references a file, its name might be a relative pathname or simple filename, rather than its absolute pathname. To identify the source absolutely, the DataSource.getURL() method (or some suitable class-specific method) should be used. If this source has a position, it should probably form part of this name.

Overrides:
getName in class DataSource
Returns:
a name

getRawInputStream

public InputStream getRawInputStream()
                              throws IOException
Description copied from class: DataSource
Provides a new InputStream for this data source. This method should be implemented by subclasses to provide a new InputStream giving the raw content of the source each time it is called. The general contract of this method is that each time it is called it will return a stream with the same content.

Specified by:
getRawInputStream in class DataSource
Returns:
an InputStream containing the data of this source
Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.