net.rim.pushsdk.commons.content
Class PngImageContent
java.lang.Object
net.rim.pushsdk.commons.content.Content
net.rim.pushsdk.commons.content.SinglePartContent
net.rim.pushsdk.commons.content.BinaryContent
net.rim.pushsdk.commons.content.PngImageContent
public class PngImageContent
- extends BinaryContent
Represents PNG image content. The content-type header is set to image/png.
- Author:
- mdandrea
|
Constructor Summary |
PngImageContent(byte[] content,
boolean shouldBase64Encode)
Constructs a PNG image with the specified content. |
PngImageContent(File file,
boolean shouldBase64Encode)
Constructs a PNG image from the specified file. |
PngImageContent(URL url,
boolean shouldBase64Encode)
Constructs a PNG image from the specified URL. |
|
Method Summary |
protected void |
checkExtension(String string)
Verifies that the image ends in the .png file extension. |
String |
toString()
Constructs a String with all attributes in name = value format. |
PngImageContent
public PngImageContent(byte[] content,
boolean shouldBase64Encode)
- Constructs a PNG image with the specified content. The image is base64 encoded if requested.
- Parameters:
content - the PNG image contentshouldBase64Encode - true if the content should be base64 encoded; false otherwise
PngImageContent
public PngImageContent(File file,
boolean shouldBase64Encode)
throws IOException
- Constructs a PNG image from the specified file. The image is base64 encoded if requested.
- Parameters:
file - the PNG image fileshouldBase64Encode - true if the content should be base64 encoded; false otherwise
- Throws:
IOException - if any IO errors occur reading from the file
PngImageContent
public PngImageContent(URL url,
boolean shouldBase64Encode)
throws IOException
- Constructs a PNG image from the specified URL. The image is base64 encoded if requested.
- Parameters:
url - the PNG image URLshouldBase64Encode - true if the content should be base64 encoded; false otherwise
- Throws:
IOException - if any IO errors occur reading from the URL
checkExtension
protected void checkExtension(String string)
- Verifies that the image ends in the .png file extension.
- Overrides:
checkExtension in class SinglePartContent
- Parameters:
string - the file name
toString
public String toString()
- Constructs a
String with all attributes in name = value format.
- Overrides:
toString in class BinaryContent
- Returns:
- a
String representation of this object.
Copyright © 2011 Research In Motion. All Rights Reserved.