ezvcard.property
Class ImageProperty

java.lang.Object
  extended by ezvcard.property.VCardProperty
      extended by ezvcard.property.BinaryProperty<ImageType>
          extended by ezvcard.property.ImageProperty
All Implemented Interfaces:
HasAltId, Comparable<VCardProperty>
Direct Known Subclasses:
Logo, Photo

public class ImageProperty
extends BinaryProperty<ImageType>

Represents a vCard property that stores image data (for example, Photo).

Author:
Michael Angstadt

Field Summary
 
Fields inherited from class ezvcard.property.BinaryProperty
contentType, data, url
 
Fields inherited from class ezvcard.property.VCardProperty
group, parameters
 
Constructor Summary
ImageProperty(byte[] data, ImageType type)
          Creates an image property.
ImageProperty(File file, ImageType type)
          Creates an image property.
ImageProperty(InputStream in, ImageType type)
          Creates an image property.
ImageProperty(String url, ImageType type)
          Creates an image property.
 
Method Summary
 
Methods inherited from class ezvcard.property.BinaryProperty
_validate, addPid, getAltId, getContentType, getData, getPids, getPref, getType, getUrl, removePids, setAltId, setContentType, setData, setPref, setType, setUrl
 
Methods inherited from class ezvcard.property.VCardProperty
_supportedVersions, addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageProperty

public ImageProperty(String url,
                     ImageType type)
Creates an image property.

Parameters:
url - the URL to the image
type - the content type (e.g. JPEG)

ImageProperty

public ImageProperty(byte[] data,
                     ImageType type)
Creates an image property.

Parameters:
data - the binary data of the image
type - the content type (e.g. JPEG)

ImageProperty

public ImageProperty(InputStream in,
                     ImageType type)
              throws IOException
Creates an image property.

Parameters:
in - an input stream to the binary data (will be closed)
type - the content type (e.g. JPEG)
Throws:
IOException - if there's a problem reading from the input stream

ImageProperty

public ImageProperty(File file,
                     ImageType type)
              throws IOException
Creates an image property.

Parameters:
file - the image file
type - the content type (e.g. JPEG)
Throws:
IOException - if there's a problem reading from the file


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.