|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.wimpi.pim.contact.basicimpl.DataContainer
A basic, simple and generic implementation of
Key
,
Sound
and Image
.
Field Summary | |
protected java.lang.String |
m_ContentType
|
protected byte[] |
m_Data
|
protected boolean |
m_isUri
|
protected java.lang.String |
m_Uri
|
Constructor Summary | |
DataContainer()
|
Method Summary | |
java.lang.String |
getContentType()
Returns the content type of this Key. |
byte[] |
getData()
Returns the non-encoded binary data representing this Key. |
byte[] |
getDataFromURI()
Returns the data obtained from the uri of this Key. |
java.io.InputStream |
getInputStream()
Returns an InputStream providing access to the data of this Key. |
java.lang.String |
getURI()
Returns the URI reference representing this Key. |
boolean |
isData()
Tests if this Key is given as binary data. |
boolean |
isURI()
Tests if this Key is given as an URI reference. |
void |
setContentType(java.lang.String ctype)
Sets the content type of this Key. |
void |
setData(byte[] data)
Sets the non-encoded binary data representing this Key. |
void |
setData(java.lang.String uri)
Sets the non-encoded binary data as obtained from the given uri. |
void |
setURI(java.lang.String uri)
Sets the URI reference representing this Key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String m_Uri
protected java.lang.String m_ContentType
protected byte[] m_Data
protected boolean m_isUri
Constructor Detail |
public DataContainer()
Method Detail |
public boolean isData()
Key
isData
in interface Key
public java.lang.String getContentType()
Key
getContentType
in interface Key
public void setContentType(java.lang.String ctype)
Key
setContentType
in interface Key
ctype
- the content type as String.public void setData(byte[] data)
Key
setData
in interface Key
data
- the non-encoded binary data as byte[].public void setData(java.lang.String uri) throws java.io.IOException, java.net.MalformedURLException
Key
setData
in interface Key
uri
- an URI as String.
java.io.IOException
java.net.MalformedURLException
public byte[] getData()
Key
getData
in interface Key
public java.lang.String getURI()
Key
getURI
in interface Key
public void setURI(java.lang.String uri)
Key
setURI
in interface Key
uri
- the URI reference as String.public boolean isURI()
Key
isURI
in interface Key
public java.io.InputStream getInputStream() throws java.io.IOException, java.net.MalformedURLException
Key
An implementation might use a ByteArrayInputStream for inlined data, or return the input stream which can be obtained from the URI (i.e. using java.net.URL).
getInputStream
in interface Key
java.io.IOException
java.net.MalformedURLException
public byte[] getDataFromURI() throws java.io.IOException, java.net.MalformedURLException
Key
getDataFromURI
in interface Key
java.io.IOException
java.net.MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |