DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
{column:width=80px|padding=0px}{column}{column}{column}
Property Summary
byte[]
bytes
A byte array holding the content of the Media object.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
{column:width=100%|padding=0px}{column}
Property Details
A byte array holding the content of the Media object.
Returns
byte[]
Sample
var ballBytes = plugins.file.readFile('d:/ball.jpg'); var mapBytes = plugins.file.readFile('d:/map.png'); var ballImage = solutionModel.newMedia('ball.jpg', ballBytes); application.output('original image name: ' + ballImage.getName()); ballImage.bytes = mapBytes; ballImage.mimeType = 'image/png'; application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed. application.output('image mime type: ' + ballImage.mimeType); application.output('image size: ' + ballImage.bytes.length);
The MIME type of the Media object.
Some examples are: 'image/jpg', 'image/png', etc.
Sample
var ballBytes = plugins.file.readFile('d:/ball.jpg'); var mapBytes = plugins.file.readFile('d:/map.png'); var ballImage = solutionModel.newMedia('ball.jpg', ballBytes); application.output('original image name: ' + ballImage.getName()); ballImage.bytes = mapBytes; ballImage.mimeType = 'image/png'; application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed. application.output('image mime type: ' + ballImage.mimeType); application.output('image size: ' + ballImage.bytes.length);
{column:width=100%|padding=0px}{column}
Method Details
getName
()
The name of the Media object.
Returns
String – A String holding the name of this Media object.
Sample
var ballBytes = plugins.file.readFile('d:/ball.jpg'); var mapBytes = plugins.file.readFile('d:/map.png'); var ballImage = solutionModel.newMedia('ball.jpg', ballBytes); application.output('original image name: ' + ballImage.getName()); ballImage.bytes = mapBytes; ballImage.mimeType = 'image/png'; application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed. application.output('image mime type: ' + ballImage.mimeType); application.output('image size: ' + ballImage.bytes.length);
Returns the UUID of this media
Sample
var ballImg = plugins.file.readFile('d:/ball.jpg'); application.output(ballImg.getUUID().toString());