Package gov.nasa.worldwind.ogc.kml.io
Class KMLInputStream
- java.lang.Object
-
- gov.nasa.worldwind.ogc.kml.io.KMLInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.InputStream
inputStream
TheInputStream
specified to the constructor.protected java.net.URI
uri
The URI of this KML document.
-
Constructor Summary
Constructors Constructor Description KMLInputStream(java.io.InputStream sourceStream, java.net.URI uri)
Construct aKMLInputStream
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getKMLStream()
Returns the input stream reference passed to the constructor.java.lang.String
getSupportFilePath(java.lang.String path)
Resolve references against the document's URI.java.io.InputStream
getSupportFileStream(java.lang.String path)
Resolve references against the document's URI.
-
-
-
Constructor Detail
-
KMLInputStream
public KMLInputStream(java.io.InputStream sourceStream, java.net.URI uri) throws java.io.IOException
Construct aKMLInputStream
instance.- Parameters:
sourceStream
- the KML stream.uri
- the URI of this KML document. This URI is used to resolve relative references. May benull
.- Throws:
java.lang.IllegalArgumentException
- if the specified input stream is null.java.io.IOException
- if an error occurs while attempting to read from the stream.
-
-
Method Detail
-
getKMLStream
public java.io.InputStream getKMLStream() throws java.io.IOException
Returns the input stream reference passed to the constructor.- Specified by:
getKMLStream
in interfaceKMLDoc
- Returns:
- the input stream reference passed to the constructor.
- Throws:
java.io.IOException
- if an error occurs while attempting to create or open the input stream.
-
getSupportFileStream
public java.io.InputStream getSupportFileStream(java.lang.String path) throws java.io.IOException
Resolve references against the document's URI.- Specified by:
getSupportFileStream
in interfaceKMLDoc
- Parameters:
path
- the path of the requested file.- Returns:
- an input stream positioned to the start of the file, or null if the file does not exist.
- Throws:
java.io.IOException
- if an error occurs while attempting to query or open the file.
-
getSupportFilePath
public java.lang.String getSupportFilePath(java.lang.String path)
Resolve references against the document's URI.- Specified by:
getSupportFilePath
in interfaceKMLDoc
- Parameters:
path
- the path of the requested file.- Returns:
- a URL to the requested file, or
null
if the document does not have a base URI.
-
-