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.InputStreaminputStreamTheInputStreamspecified to the constructor.protected java.net.URIuriThe URI of this KML document.
-
Constructor Summary
Constructors Constructor Description KMLInputStream(java.io.InputStream sourceStream, java.net.URI uri)Construct aKMLInputStreaminstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetKMLStream()Returns the input stream reference passed to the constructor.java.lang.StringgetSupportFilePath(java.lang.String path)Resolve references against the document's URI.java.io.InputStreamgetSupportFileStream(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.IOExceptionConstruct aKMLInputStreaminstance.- 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.IOExceptionReturns the input stream reference passed to the constructor.- Specified by:
getKMLStreamin 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.IOExceptionResolve references against the document's URI.- Specified by:
getSupportFileStreamin 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:
getSupportFilePathin interfaceKMLDoc- Parameters:
path- the path of the requested file.- Returns:
- a URL to the requested file, or
nullif the document does not have a base URI.
-
-