Unsolved
This post is more than 5 years old
6 Posts
0
1730
April 20th, 2011 19:00
How do I get the file size of a file on Centera?
Hi,
How do I get the file size of a file on Centera using the Java org.snia.xam API?
I know the XUID, and would like to know the file size without having to download the file first.
Cheers,
Keith.
No Events found!
mckeown_paul
409 Posts
0
April 21st, 2011 07:00
Open the xset then try calling
XAM_GetFieldLength
on the field that is the xstream for your blob
thisismyscreen2
6 Posts
0
April 24th, 2011 14:00
So, something like the following...?
private long getFileSize(String b64XUID) throws XAMException{
XAMXUID xuID = new XAMXUID(b64XUID);
XSet xSet = xSystem.openXSet(xuID, XSet.MODE_READ_ONLY);
long fileSize = xSet.getFieldLength("What on earth goes here....???");
return fileSize;
}
I am not quite sure what you mean by "XAM_GetFieldLength", but am guessing you mean the "public long getFieldLength(java.lang.String fieldName)" method of the interface "org.snia.xam.FieldContainer"?
If so, then I have no idea what the "fieldName" parameter for the method should be? Nor exactly which of the
various objects that implement the FieldContainer interface I should be calling the method on, but have guessed
the XSet object is the one?
And I also have no idea what the "field" means when you say "on the field that is the xstream for your blob"?
gstuartemc
2 Intern
•
417 Posts
0
April 26th, 2011 08:00
Look at the Java code samples for XAM that can be found elsewhere in the foums. These clearly demonstrate how to work with fields and field iterators for the storage and retrieval of content.
The "What on earth goes here ...???" is the name of the field that you created, so it varies from application to application. It can be any valid XAM field name i.e. not a predefined XAM field, in the reserved namespace etc.
If you don't know what a field is I suggest you read the XAM Architecture Spec as that is one of the most basic (and fundamental) concepts. You can find that on the SNIA website.