Explicitly requesting the extension attribute from the BoxFile.Info object’s getInfo method provides the expected value.
However, if requesting the entire BoxFile.Info object’s getInfo’s set of attributes, not explicitly specifying fields to be returned, the extension attribute value is missing.
In addition, the SHA1 attribute, which is another specific BoxFile extension to BoxInfo, exists.
I would expect both to be provided, but extension is not.
Attempted with Box Java SDK versions 4.7.0 and 4.8.0.
For example:
BoxFile.Info info = file.getInfo("extension");
System.out.println(info.getExtension());
BoxFile.Info info = file.getInfo("sha1");
System.out.println(info.getSha1());
BoxFile.Info info = file.getInfo();
System.out.println(info.getExtension());
System.out.println(info.getSha1());
Example output:
doc
bddf8a01e139522c81c59b10df840c4379e24cfb
null
bddf8a01e139522c81c59b10df840c4379e24cfb
The null output is unexpected.