uk.ac.starlink.util
Class URLDataSource

java.lang.Object
  extended byuk.ac.starlink.util.DataSource
      extended byuk.ac.starlink.util.URLDataSource

public class URLDataSource
extends DataSource

A DataSource implementation based on a URL.


Field Summary
 
Fields inherited from class uk.ac.starlink.util.DataSource
DEFAULT_INTRO_LIMIT, MARK_WORKAROUND_PROPERTY
 
Constructor Summary
URLDataSource(URL url)
          Constructs a DataSource from a URL.
 
Method Summary
protected  InputStream getRawInputStream()
          Provides a new InputStream for this data source.
 URL getURL()
          Returns the URL on which this URLDataSource is based.
 
Methods inherited from class uk.ac.starlink.util.DataSource
close, forceCompression, getCompression, getHybridInputStream, getInputStream, getInputStream, getIntro, getIntroLimit, getLength, getMarkWorkaround, getName, getPosition, getRawLength, getSystemId, 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

URLDataSource

public URLDataSource(URL url)
Constructs a DataSource from a URL. If the URL has a ref part (the bit after the '#') it will be treated as the position attribute of this DataSource.

Method Detail

getRawInputStream

protected 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

getURL

public URL getURL()
Returns the URL on which this URLDataSource is based.

Overrides:
getURL in class DataSource
Returns:
the URL

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.