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, setExtension
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContentType, getExtension
protected UrlImage(String urlAsString) throws URISyntaxException, MalformedURLException
urlAsString
- the URL as a String, e.g. "http://localhost:8080/images/mygif.gif"URISyntaxException
MalformedURLException
protected UrlImage(URL url) throws URISyntaxException
url
- the URLURISyntaxException
public URL getUrl()
public long getSize() throws IOException
Resource
getSize
in interface Resource
IOException
public InputStream getInputStream() throws IOException
Resource
getInputStream
in interface Resource
IOException
public byte[] getBytes() throws IOException
Resource
getBytes
in interface Resource
IOException
public ByteString getByteString() throws IOException
Resource
getByteString
in interface Resource
IOException
public String getUriAsString()
UriResource
getUriAsString
in interface UriResource
public ResourceInfo getResourceInfo()
getResourceInfo
in interface UriImage
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries