edu.udo.cs.wvtool.generic.loader
Class UniversalLoader

java.lang.Object
  extended by edu.udo.cs.wvtool.generic.loader.UniversalLoader
All Implemented Interfaces:
WVTDocumentLoader

public class UniversalLoader
extends java.lang.Object
implements WVTDocumentLoader

Loader, which is able to load individual documents from an URL or simply from a local file given by the source name in document information. The loader first tries to parse the given document source as a URL and only if this fails, tries to interpret it as a local path.

Version:
$Id: UniversalLoader.java,v 1.2 2006/06/06 11:45:24 mjwurst Exp $
Author:
Michael Wurst

Field Summary
private  java.io.InputStream currentInputStream
           
 
Constructor Summary
UniversalLoader()
          Constructor for UniversalLoader.
 
Method Summary
 void close(WVTDocumentInfo d)
          Close the resource from which the given document has been read.
 java.io.InputStream loadDocument(WVTDocumentInfo d)
          Open the document and return an input stream on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentInputStream

private java.io.InputStream currentInputStream
Constructor Detail

UniversalLoader

public UniversalLoader()
Constructor for UniversalLoader.

Method Detail

loadDocument

public java.io.InputStream loadDocument(WVTDocumentInfo d)
                                 throws WVToolException
Description copied from interface: WVTDocumentLoader
Open the document and return an input stream on it.

Specified by:
loadDocument in interface WVTDocumentLoader
Parameters:
d - the WVTDocumentInfo about the document being loaded
Returns:
an InputStream
Throws:
WVToolException
See Also:
WVTDocumentLoader.loadDocument(WVTDocumentInfo)


close

public void close(WVTDocumentInfo d)
           throws WVToolException
Description copied from interface: WVTDocumentLoader
Close the resource from which the given document has been read.

Specified by:
close in interface WVTDocumentLoader
Parameters:
d - the WVTDocumentInfo about the document
Throws:
WVToolException
See Also:
WVTDocumentLoader.close(WVTDocumentInfo)