public class UrlImage extends AbstractImage implements UriImage
| Modifier | Constructor and Description |
|---|---|
protected |
UrlImage(String urlAsString)
Create a UrlImage from a urlString, this method is protected to force use
of the ImageFactory.
|
protected |
UrlImage(URL url)
Create a UrlImage from a URL, this method is protected to force use
of the ImageFactory.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
byte[] |
getBytes()
Return the resource as a byte array.
|
ByteString |
getByteString()
Return the resource as a byte array's clone.
|
InputStream |
getInputStream()
Create an input stream for this resource.
|
ResourceInfo |
getResourceInfo() |
long |
getSize()
Return size of the resource in bytes.
|
String |
getUriAsString()
Returns the uri (and hence a unique identifier) for a resource as a String.
|
URL |
getUrl() |
int |
hashCode() |
String |
toString() |
getContentType, getExtension, setContentType, setExtensionclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContentType, getExtensionprotected UrlImage(String urlAsString) throws URISyntaxException, MalformedURLException
urlAsString - the URL as a String, e.g. "http://localhost:8080/images/mygif.gif"URISyntaxExceptionMalformedURLExceptionprotected UrlImage(URL url) throws URISyntaxException
url - the URLURISyntaxExceptionpublic URL getUrl()
public long getSize()
throws IOException
ResourcegetSize in interface ResourceIOExceptionpublic InputStream getInputStream() throws IOException
ResourcegetInputStream in interface ResourceIOExceptionpublic byte[] getBytes()
throws IOException
ResourcegetBytes in interface ResourceIOExceptionpublic ByteString getByteString() throws IOException
ResourcegetByteString in interface ResourceIOExceptionpublic String getUriAsString()
UriResourcegetUriAsString in interface UriResourcepublic ResourceInfo getResourceInfo()
getResourceInfo in interface UriImageCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries