Package org.apache.tomcat.util.file
Class ConfigurationSource.Resource
- java.lang.Object
-
- org.apache.tomcat.util.file.ConfigurationSource.Resource
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Enclosing interface:
- ConfigurationSource
public static class ConfigurationSource.Resource extends java.lang.Object implements java.lang.AutoCloseableRepresents a resource: a stream to the resource associated with its URI.
-
-
Constructor Summary
Constructors Constructor Description Resource(java.io.InputStream inputStream, java.net.URI uri)Creates a new resource with the given input stream and URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.io.InputStreamgetInputStream()Returns the input stream for reading the resource content.longgetLastModified()Returns the last modified time of the resource in milliseconds since the epoch.java.net.URIgetURI()Returns the URI that identifies the resource location.
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
Returns the input stream for reading the resource content.- Returns:
- the input stream
-
getURI
public java.net.URI getURI()
Returns the URI that identifies the resource location.- Returns:
- the resource URI
-
getLastModified
public long getLastModified() throws java.net.MalformedURLException, java.io.IOExceptionReturns the last modified time of the resource in milliseconds since the epoch.- Returns:
- the last modified time in milliseconds
- Throws:
java.net.MalformedURLException- if the resource URI cannot be converted to a URLjava.io.IOException- if an I/O error occurs while fetching the last modified time
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
-