@Component public class ImageFactory extends Object implements UriImageFactory
Constructor and Description |
---|
ImageFactory() |
Modifier and Type | Method and Description |
---|---|
UriImage |
create(String uriAsString)
Create a UriImage from a URI as a string.
|
UriImage |
create(String uriAsString,
String extension)
Create a UriImage from a URI as a string which has a known image extension (specifying
the extension means that we don't need to look it up).
|
UriImage |
create(URL url)
Create a UriImage from a URL.
|
protected UriImage |
create(URL url,
String extension)
Create a UriImage from a URL with a known extension (so we don't have to look it up).
|
FileImage |
createFileImage(File imageFile)
Create a FileImage from a File.
|
protected FileImage |
createFileImage(File imageFile,
String extension)
Create a FileImage from a File which has a known extension (so we don't have to look it up).
|
FileImage |
createFileImage(String imagePath)
Create a FileImage from a file path.
|
protected FileImage |
createFileImage(String imagePath,
String extension)
Create a FileImage from a file path which has a known extension (so we don't have to look it up).
|
TransformedImage |
createTransformedImage(BufferedImage bufferedImage,
String outputFormat)
Create a transformed image (of the desired format) from a bufferedImage.
|
TransformedImage |
createTransformedImage(Image image)
Create a transformed image (of the desired format) from an Image.
|
TransformedImage |
createTransformedImage(Image image,
String extension)
Create a transformed image (of the desired format) from an Image.
|
protected UrlImage |
createUrlImage(URL url,
String extension) |
public UriImage create(String uriAsString) throws URISyntaxException, IOException
create
in interface ResourceFactory<UriImage>
uriAsString
- the URL as a string, e.g. "http://localhost:8080/images/mygif.gif"URISyntaxException
IOException
public UriImage create(String uriAsString, String extension) throws URISyntaxException, IOException
create
in interface ResourceFactory<UriImage>
uriAsString
- the URL as a string, e.g. "http://localhost:8080/images/mypng.png"extension
- the image extension e.g. "png"URISyntaxException
IOException
public TransformedImage createTransformedImage(BufferedImage bufferedImage, String outputFormat)
bufferedImage
- a buffered imageoutputFormat
- the output format required e.g. "png"public TransformedImage createTransformedImage(Image image) throws IOException
image
- an imageIOException
public TransformedImage createTransformedImage(Image image, String extension) throws IOException
image
- an imageextension
- the output format required e.g. "png"IOException
public UriImage create(URL url) throws URISyntaxException, IOException
create
in interface UriImageFactory
url
- the URLURISyntaxException
IOException
public FileImage createFileImage(String imagePath) throws IOException
imagePath
- the path of a file which contains an image, e.g.
cwd-image-extension/target/test-classes/pictures/snow.jpgIOException
public FileImage createFileImage(File imageFile) throws IOException
imageFile
- the File which contains an imageIOException
protected UriImage create(URL url, String extension) throws URISyntaxException, IOException
url
- the URLextension
- the image extension e.g. "png"URISyntaxException
IOException
protected FileImage createFileImage(String imagePath, String extension) throws IOException
imagePath
- the path of a file which contains an image, e.g.
cwd-image-extension/target/test-classes/pictures/snow.jpgextension
- the image extension e.g. "png"IOException
protected FileImage createFileImage(File imageFile, String extension) throws IOException
imageFile
- the File which contains an imageextension
- the image extension e.g. "png"IOException
protected UrlImage createUrlImage(URL url, String extension) throws URISyntaxException, IOException
URISyntaxException
IOException
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries