BoxFile extends BoxCollaborationItem { public static BoxFile createFromIdAndName(String fileId, String name) { JsonObject object = new JsonObject(); object.add(BoxItem.FIELD_ID, fileId); object.add(BoxItem.FIELD_TYPE, BoxFile.TYPE); if (!TextUtils.isEmpty(name)) { object.add(BoxItem.FIELD_NAME, name); } return new BoxFile(object); } BoxFile();  BoxFile(JsonObject object); static BoxFile createFromId(String fileId); static BoxFile createFromIdAndName(String fileId, String name); BoxFileVersion getFileVersion(); String getSha1(); String getVersionNumber(); String getExtension(); Boolean getIsPackage(); String getUploaderDisplayName(); @Override Date getContentCreatedAt(); @Override Long getSize(); @Override Date getContentModifiedAt(); @Override Long getCommentCount(); BoxIteratorRepresentations getRepresentations(); static final String TYPE; static final String FIELD_SHA1; static final String FIELD_VERSION_NUMBER; static final String FIELD_EXTENSION; static final String FIELD_IS_PACKAGE; static final String FIELD_COMMENT_COUNT; static final String FIELD_SIZE; static final String FIELD_UPLOADER_DISPLAY_NAME; static final String FIELD_CONTENT_CREATED_AT; static final String FIELD_CONTENT_MODIFIED_AT; static final String FIELD_FILE_VERSION; static final String FIELD_REPRESENTATIONS; static final String[] ALL_FIELDS; }
@Test public void testCreateFromIdAndName() { String expectedId = "5"; String expectedType = BoxFile.TYPE; String expectedName = "Name.txt"; BoxFile file = BoxFile.createFromIdAndName(expectedId, expectedName); String id = file.getId(); String type = file.getType(); String name = file.getName(); Assert.assertEquals(expectedId, id); Assert.assertEquals(expectedType, type); Assert.assertEquals(expectedName, name); }