|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fourthline.cling.model.meta.Icon
public class Icon
The metadata of a device icon, might include the actual image data of a local icon.
Note that validation of icons is lax on purpose, a valid Icon
might still
return null
from getMimeType()
, getWidth()
,
getHeight()
, and getDepth()
. However, getUri()
will return
a valid URI for a valid Icon
.
Constructor Summary | |
---|---|
protected |
Icon(org.seamless.util.MimeType mimeType,
int width,
int height,
int depth,
URI uri,
byte[] data)
|
|
Icon(String mimeType,
int width,
int height,
int depth,
File file)
Use this constructor if your local icon data can be resolved with a File , the file's
name must be unique within the scope of a device. |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
byte[] data)
Use this constructor if your local icon data is in a byte[] . |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
InputStream is)
Use this constructor if your local icon data is an InputStream . |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
String binHexEncoded)
Use this constructor if your local icon is binary data encoded with BinHex. |
|
Icon(String mimeType,
int width,
int height,
int depth,
URI uri)
Used internally by Cling when RemoteDevice is discovered, you shouldn't have to call this. |
|
Icon(String mimeType,
int width,
int height,
int depth,
URL url)
Use this constructor if your local icon data can be resolved on the classpath, for example: MyClass.class.getResource("/my/icon.png) |
Method Summary | |
---|---|
Icon |
deepCopy()
|
byte[] |
getData()
|
int |
getDepth()
|
Device |
getDevice()
|
int |
getHeight()
|
org.seamless.util.MimeType |
getMimeType()
|
URI |
getUri()
|
int |
getWidth()
|
String |
toString()
|
List<ValidationError> |
validate()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Icon(String mimeType, int width, int height, int depth, URI uri)
RemoteDevice
is discovered, you shouldn't have to call this.
public Icon(String mimeType, int width, int height, int depth, URL url) throws IOException
MyClass.class.getResource("/my/icon.png)
url
- A URL of the icon data that can be read with new File(url.toURI())
.
IOException
public Icon(String mimeType, int width, int height, int depth, File file) throws IOException
File
, the file's
name must be unique within the scope of a device.
IOException
public Icon(String mimeType, int width, int height, int depth, String uniqueName, InputStream is) throws IOException
InputStream
.
uniqueName
- Must be a valid URI path segment and unique within the scope of a device.
IOException
public Icon(String mimeType, int width, int height, int depth, String uniqueName, byte[] data)
byte[]
.
uniqueName
- Must be a valid URI path segment and unique within the scope of a device.public Icon(String mimeType, int width, int height, int depth, String uniqueName, String binHexEncoded)
uniqueName
- Must be a valid URI path segment and unique within the scope of a device.binHexEncoded
- The icon bytes encoded as BinHex.protected Icon(org.seamless.util.MimeType mimeType, int width, int height, int depth, URI uri, byte[] data)
Method Detail |
---|
public org.seamless.util.MimeType getMimeType()
public int getWidth()
public int getHeight()
public int getDepth()
public URI getUri()
public byte[] getData()
public Device getDevice()
public List<ValidationError> validate()
validate
in interface Validatable
List
if all rules validated properly, otherwise, the detected errors.public Icon deepCopy()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |