VladP
VladP

Reputation: 901

Is there a way to get attached file properties?

I have a media file attached to my Notes document. And here is my code to pull file size info:

RichTextItem body = (RichTextItem)COLL_DOC.getFirstItem("Body");
Vector atts = body.getEmbeddedObjects();

for (int i = 0; i < atts.size(); i++) {
    EmbeddedObject att = (EmbeddedObject)atts.elementAt(i);
    if (att.getType() == EmbeddedObject.EMBED_ATTACHMENT) {
        System.out.println(att.getFileSize());
    }
}

But I need to get media file length in seconds instead of file size in bytes. So is there an easy way to get video length or get attached file properties that shows video length?

Upvotes: 0

Views: 70

Answers (1)

Ran Koretzki
Ran Koretzki

Reputation: 484

The documantation of EmbeddedObject just give filesize or you can extact the file to store it in local file system. If it is possible, you can get the duration by using xuggler library.

Upvotes: 1

Related Questions