net.sourceforge.groboutils.util.io.v1
Class URLInputStreamGenerator
java.lang.Object
net.sourceforge.groboutils.util.io.v1.URLInputStreamGenerator
- All Implemented Interfaces:
- IInputStreamGenerator
- public class URLInputStreamGenerator
- extends java.lang.Object
- implements IInputStreamGenerator
A type of class which can generate a new InputStream based on just a
partial name. Useful if a resource is loaded from a specific location
(classpath resource, file system, URL, etc), and it references other
resources which must be loaded relative to it.
- Since:
- 0.9.1d Alpha (sometime in 2001)
- Version:
- $Date: 2003/02/10 22:52:45 $
- Author:
- Matt Albrecht groboclown@users.sourceforge.net
Constructor Summary |
URLInputStreamGenerator(java.lang.String originalName)
Accepts the name of the 1st file loaded. |
Method Summary |
java.io.InputStream |
createInputStream(java.lang.String relativeName)
|
java.lang.String |
getFullName(java.lang.String relativeName)
|
java.net.URL |
getURL(java.lang.String relativeName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLInputStreamGenerator
public URLInputStreamGenerator(java.lang.String originalName)
throws java.io.IOException
- Accepts the name of the 1st file loaded. All files generated from
this generator will be relative to its location.
getURL
public java.net.URL getURL(java.lang.String relativeName)
throws java.io.IOException
- Throws:
java.io.IOException
getFullName
public java.lang.String getFullName(java.lang.String relativeName)
- Specified by:
getFullName
in interface IInputStreamGenerator
createInputStream
public java.io.InputStream createInputStream(java.lang.String relativeName)
throws java.io.IOException
- Specified by:
createInputStream
in interface IInputStreamGenerator
- Throws:
java.io.IOException
Copyright © 2001-2003 by The GroboUtils Project