Fields Summary |
---|
public static final Set | ALLOWEDStores the allowed {@linkplain MetadataDescriptor#getName() descriptor
keys}. |
public static final String | KEY_BANNER_IMAGEDescriptor key representing the banner image. |
public static final String | KEY_BANNER_TYPEDescriptor key representing the banner image type.
Known/valid values are:
- 0: there is no image present
- 1: there is a BMP image
- 2: there is a JPEG image
- 3: there is a GIF image
|
public static final String | KEY_BANNER_URLDescriptor key representing the banner image URL. |
public static final String | KEY_COPYRIGHT_URLDescriptor key representing the copyright URL. |
Methods Summary |
---|
public java.lang.String | getBannerImageURL()Returns the banner image URL.
return getValueFor(KEY_BANNER_URL);
|
public java.lang.String | getCopyRightURL()Returns the copyright URL.
return getValueFor(KEY_COPYRIGHT_URL);
|
public long | getCurrentAsfChunkSize(){@inheritDoc}
// GUID, size, image type, image data size, image url data size,
// copyright data size
long result = 40;
result += assertDescriptor(KEY_BANNER_IMAGE,
MetadataDescriptor.TYPE_BINARY).getRawDataSize();
result += getBannerImageURL().length();
result += getCopyRightURL().length();
return result;
|
public byte[] | getImageData()Returns the binary image data.
return assertDescriptor(KEY_BANNER_IMAGE,
MetadataDescriptor.TYPE_BINARY).getRawData();
|
public long | getImageType()Returns the image type.
if (!hasDescriptor(KEY_BANNER_TYPE)) {
final MetadataDescriptor descriptor = new MetadataDescriptor(
ContainerType.CONTENT_BRANDING, KEY_BANNER_TYPE,
MetadataDescriptor.TYPE_DWORD);
descriptor.setDWordValue(0);
addDescriptor(descriptor);
}
return assertDescriptor(KEY_BANNER_TYPE).getNumber();
|
public boolean | isAddSupported(MetadataDescriptor descriptor){@inheritDoc}
return ALLOWED.contains(descriptor.getName())
&& super.isAddSupported(descriptor);
|
public void | setBannerImageURL(java.lang.String imageURL)This method sets the banner image URL, if imageURL is not
blank.
if (Utils.isBlank(imageURL)) {
removeDescriptorsByName(KEY_BANNER_URL);
} else {
assertDescriptor(KEY_BANNER_URL).setStringValue(imageURL);
}
|
public void | setCopyRightURL(java.lang.String copyRight)This method sets the copyright URL, if copyRight is not
blank.
if (Utils.isBlank(copyRight)) {
removeDescriptorsByName(KEY_COPYRIGHT_URL);
} else {
assertDescriptor(KEY_COPYRIGHT_URL).setStringValue(copyRight);
}
|
public void | setImage(long imageType, byte[] imageData)
assert imageType >= 0 && imageType <= 3;
assert imageType > 0 || imageData.length == 0;
assertDescriptor(KEY_BANNER_TYPE, MetadataDescriptor.TYPE_DWORD)
.setDWordValue(imageType);
assertDescriptor(KEY_BANNER_IMAGE, MetadataDescriptor.TYPE_BINARY)
.setBinaryValue(imageData);
|
public long | writeInto(java.io.OutputStream out){@inheritDoc}
final long chunkSize = getCurrentAsfChunkSize();
out.write(getGuid().getBytes());
Utils.writeUINT64(chunkSize, out);
Utils.writeUINT32(getImageType(), out);
assert getImageType() >= 0 && getImageType() <= 3;
final byte[] imageData = getImageData();
assert getImageType() > 0 || imageData.length == 0;
Utils.writeUINT32(imageData.length, out);
out.write(imageData);
Utils.writeUINT32(getBannerImageURL().length(), out);
out.write(getBannerImageURL().getBytes("ASCII"));
Utils.writeUINT32(getCopyRightURL().length(), out);
out.write(getCopyRightURL().getBytes("ASCII"));
return chunkSize;
|