Package org.fest.swing.junit.ant
Class ImageHandler
java.lang.Object
org.fest.swing.junit.ant.ImageHandler
Understands base64 encoding and decoding of an image.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static ImageDecoder
private static ImageEncoder
private static org.fest.swing.image.ImageFileWriter
private static Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImage
decodeBase64
(String encoded) Decodes the given base64 characters into an image.(package private) static BufferedImage
decodeBase64
(String encoded, ImageDecoder decoder) static String
decodeBase64AndSaveAsPng
(String encoded, String path) Decodes the given base64 characters into an image, and saves the decoded image as a file using the given path.(package private) static String
decodeBase64AndSaveAsPng
(String encoded, String path, ImageDecoder decoder, org.fest.swing.image.ImageFileWriter writer) static String
encodeBase64
(BufferedImage image) Encodes the given image using the base64 algorithm.(package private) static String
encodeBase64
(BufferedImage image, ImageEncoder encoder)
-
Field Details
-
EMPTY_STRING
- See Also:
-
logger
-
imageEncoder
-
imageDecoder
-
imageFileWriter
private static org.fest.swing.image.ImageFileWriter imageFileWriter
-
-
Constructor Details
-
ImageHandler
private ImageHandler()
-
-
Method Details
-
encodeBase64
Encodes the given image using the base64 algorithm. Failures in encoding an image are simply logged, no exceptions are thrown.- Parameters:
image
- the image to encode.- Returns:
- base64 characters.
-
encodeBase64
-
decodeBase64
Decodes the given base64 characters into an image. Failures in decoding base64 characters are simply logged, no exceptions are thrown.- Parameters:
encoded
- the given base64 characters.- Returns:
- the decoded image.
-
decodeBase64
-
decodeBase64AndSaveAsPng
Decodes the given base64 characters into an image, and saves the decoded image as a file using the given path. Failures in decoding or saving the image as a file are simply logged, no exceptions are thrown.- Parameters:
encoded
- the given base64 characters.path
- the path where to save the image file.- Returns:
- empty
String
. This method is used by this extensions XSL stylesheets to decode the image in the XML report.
-
decodeBase64AndSaveAsPng
static String decodeBase64AndSaveAsPng(String encoded, String path, ImageDecoder decoder, org.fest.swing.image.ImageFileWriter writer)
-