public class UrlResource extends AbstractResource implements Resource
| Constructor and Description |
|---|
UrlResource(java.lang.String url) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureUrlConnection(java.net.URLConnection conn) |
boolean |
exists()
This implementation checks whether a File can be opened,
falling back to whether an InputStream can be opened.
|
java.lang.String |
getDescription()
Return a description for this resource,
to be used for error output when working with the resource.
|
java.io.File |
getFile()
Return a File handle for this resource.
|
java.io.InputStream |
getInputStream()
Return an
InputStream. |
long |
lastModified()
Determine the last-modified timestamp for this resource.
|
getURI, getURL, toStringprotected final Logger logger
@Nonnull public java.io.File getFile()
ResourcegetFile in interface ResourcegetFile in class AbstractResourcepublic boolean exists()
AbstractResourceexists in interface Resourceexists in class AbstractResourcepublic long lastModified()
ResourcelastModified in interface ResourcelastModified in class AbstractResourceprotected void configureUrlConnection(java.net.URLConnection conn)
@Nonnull public java.io.InputStream getInputStream()
ResourceInputStream.
It is expected that each call creates a fresh stream.
getInputStream in interface Resourcenull)public java.lang.String getDescription()
ResourceImplementations are also encouraged to return this value
from their toString method.
getDescription in interface ResourceObject.toString()Copyright © 2019. All Rights Reserved.