|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiweekly.property.ICalProperty
biweekly.property.Attachment
public class Attachment
Represents a binary resource that is associated with an event, to-do, journal entry, or alarm.
Examples:
//from a byte array
byte[] data = ...
Attachment attach = new Attachment("image/png", data);
//reading from a file
Attachment attach = new Attachment("image/png", new File("image.png"));
//referencing a URL
Attachment attach = new Attachment("image/png", "http://example.com/image.png");
| Field Summary |
|---|
| Fields inherited from class biweekly.property.ICalProperty |
|---|
parameters |
| Constructor Summary | |
|---|---|
Attachment(String formatType,
byte[] data)
Creates a new attachment. |
|
Attachment(String formatType,
File file)
Creates a new attachment. |
|
Attachment(String formatType,
String uri)
Creates a new attachment. |
|
| Method Summary | |
|---|---|
byte[] |
getData()
Gets the attachment's binary data. |
String |
getFormatType()
Gets the content-type of the property's value. |
String |
getUri()
Gets the attachment's URI. |
void |
setData(byte[] data)
Sets the attachment's binary data. |
void |
setFormatType(String formatType)
Sets the content-type of the property's value. |
void |
setUri(String uri)
Sets the attachment's URI. |
protected void |
validate(List<ICalComponent> components,
List<String> warnings)
Checks the property for data consistency problems or deviations from the spec. |
| Methods inherited from class biweekly.property.ICalProperty |
|---|
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Attachment(String formatType,
File file)
throws IOException
formatType - the content-type of the data (e.g. "image/png")file - the file to attach
IOException - if there's a problem reading from the file
public Attachment(String formatType,
byte[] data)
formatType - the content-type of the data (e.g. "image/png")data - the binary data
public Attachment(String formatType,
String uri)
formatType - the content-type of the data (e.g. "image/png")uri - a URL pointing to the resource (e.g.
"http://example.com/image.png")| Method Detail |
|---|
public byte[] getData()
public void setData(byte[] data)
data - the binary datapublic String getUri()
public void setUri(String uri)
uri - the URI (e.g. "http://example.com/image.png")public String getFormatType()
ICalProperty
public void setFormatType(String formatType)
ICalProperty
formatType - the content type (e.g. "image/png") or null to remove
protected void validate(List<ICalComponent> components,
List<String> warnings)
ICalProperty
validate in class ICalPropertycomponents - the hierarchy of components that the property belongs
towarnings - the list to add the warnings to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||