repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
box/box-java-sdk
src/main/java/com/box/sdk/BoxFile.java
BoxFile.lock
public BoxLock lock(Date expiresAt, boolean isDownloadPrevented) { String queryString = new QueryStringBuilder().appendParam("fields", "lock").toString(); URL url = FILE_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); BoxAPIRequest request = new BoxAPIRequest(...
java
public BoxLock lock(Date expiresAt, boolean isDownloadPrevented) { String queryString = new QueryStringBuilder().appendParam("fields", "lock").toString(); URL url = FILE_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); BoxAPIRequest request = new BoxAPIRequest(...
[ "public", "BoxLock", "lock", "(", "Date", "expiresAt", ",", "boolean", "isDownloadPrevented", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", "\"fields\"", ",", "\"lock\"", ")", ".", "toString", "(", ")",...
Locks a file. @param expiresAt expiration date of the lock. @param isDownloadPrevented is downloading of file prevented when locked. @return the lock returned from the server.
[ "Locks", "a", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L1199-L1222
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFile.java
BoxFile.unlock
public void unlock() { String queryString = new QueryStringBuilder().appendParam("fields", "lock").toString(); URL url = FILE_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "PUT"); JsonObj...
java
public void unlock() { String queryString = new QueryStringBuilder().appendParam("fields", "lock").toString(); URL url = FILE_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "PUT"); JsonObj...
[ "public", "void", "unlock", "(", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", "\"fields\"", ",", "\"lock\"", ")", ".", "toString", "(", ")", ";", "URL", "url", "=", "FILE_URL_TEMPLATE", ".", "build...
Unlocks a file.
[ "Unlocks", "a", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L1227-L1237
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFile.java
BoxFile.updateMetadata
public Metadata updateMetadata(Metadata metadata) { String scope; if (metadata.getScope().equals(Metadata.GLOBAL_METADATA_SCOPE)) { scope = Metadata.GLOBAL_METADATA_SCOPE; } else { scope = Metadata.ENTERPRISE_METADATA_SCOPE; } URL url = METADATA_URL_TEMPL...
java
public Metadata updateMetadata(Metadata metadata) { String scope; if (metadata.getScope().equals(Metadata.GLOBAL_METADATA_SCOPE)) { scope = Metadata.GLOBAL_METADATA_SCOPE; } else { scope = Metadata.ENTERPRISE_METADATA_SCOPE; } URL url = METADATA_URL_TEMPL...
[ "public", "Metadata", "updateMetadata", "(", "Metadata", "metadata", ")", "{", "String", "scope", ";", "if", "(", "metadata", ".", "getScope", "(", ")", ".", "equals", "(", "Metadata", ".", "GLOBAL_METADATA_SCOPE", ")", ")", "{", "scope", "=", "Metadata", ...
Updates the file metadata. @param metadata the new metadata values. @return the metadata returned from the server.
[ "Updates", "the", "file", "metadata", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L1289-L1304
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFile.java
BoxFile.createUploadSession
public BoxFileUploadSession.Info createUploadSession(long fileSize) { URL url = UPLOAD_SESSION_URL_TEMPLATE.build(this.getAPI().getBaseUploadURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); request.addHeader("Content-Type", "application/json"); ...
java
public BoxFileUploadSession.Info createUploadSession(long fileSize) { URL url = UPLOAD_SESSION_URL_TEMPLATE.build(this.getAPI().getBaseUploadURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); request.addHeader("Content-Type", "application/json"); ...
[ "public", "BoxFileUploadSession", ".", "Info", "createUploadSession", "(", "long", "fileSize", ")", "{", "URL", "url", "=", "UPLOAD_SESSION_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseUploadURL", "(", ")", ",", "this", ".", ...
Creates an upload session to create a new version of a file in chunks. This will first verify that the version can be created and then open a session for uploading pieces of the file. @param fileSize the size of the file that will be uploaded. @return the created upload session instance.
[ "Creates", "an", "upload", "session", "to", "create", "a", "new", "version", "of", "a", "file", "in", "chunks", ".", "This", "will", "first", "verify", "that", "the", "version", "can", "be", "created", "and", "then", "open", "a", "session", "for", "uploa...
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L1392-L1408
train
box/box-java-sdk
src/main/java/com/box/sdk/EventLog.java
EventLog.getEnterpriseEvents
public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types) { return getEnterpriseEvents(api, null, after, before, ENTERPRISE_LIMIT, types); }
java
public static EventLog getEnterpriseEvents(BoxAPIConnection api, Date after, Date before, BoxEvent.Type... types) { return getEnterpriseEvents(api, null, after, before, ENTERPRISE_LIMIT, types); }
[ "public", "static", "EventLog", "getEnterpriseEvents", "(", "BoxAPIConnection", "api", ",", "Date", "after", ",", "Date", "before", ",", "BoxEvent", ".", "Type", "...", "types", ")", "{", "return", "getEnterpriseEvents", "(", "api", ",", "null", ",", "after", ...
Gets all the enterprise events that occurred within a specified date range. @param api the API connection to use. @param after the lower bound on the timestamp of the events returned. @param before the upper bound on the timestamp of the events returned. @param types an optional list of event types to filter b...
[ "Gets", "all", "the", "enterprise", "events", "that", "occurred", "within", "a", "specified", "date", "range", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/EventLog.java#L74-L76
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxStoragePolicy.java
BoxStoragePolicy.getInfo
public BoxStoragePolicy.Info getInfo(String... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = STORAGE_POLICY_WITH_ID_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), builder.t...
java
public BoxStoragePolicy.Info getInfo(String... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = STORAGE_POLICY_WITH_ID_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), builder.t...
[ "public", "BoxStoragePolicy", ".", "Info", "getInfo", "(", "String", "...", "fields", ")", "{", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", "(", "fields", ".", "length", ">", "0", ")", "{", "builder", ".", "appen...
Gets information for a Box Storage Policy with optional fields. @param fields the fields to retrieve. @return info about this item containing only the specified fields, including storage policy.
[ "Gets", "information", "for", "a", "Box", "Storage", "Policy", "with", "optional", "fields", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicy.java#L46-L57
train
box/box-java-sdk
src/main/java/com/box/sdk/LargeFileUpload.java
LargeFileUpload.upload
public BoxFile.Info upload(BoxAPIConnection boxApi, String folderId, InputStream stream, URL url, String fileName, long fileSize) throws InterruptedException, IOException { //Create a upload session BoxFileUploadSession.Info session = this.createUploadSession(boxApi, folde...
java
public BoxFile.Info upload(BoxAPIConnection boxApi, String folderId, InputStream stream, URL url, String fileName, long fileSize) throws InterruptedException, IOException { //Create a upload session BoxFileUploadSession.Info session = this.createUploadSession(boxApi, folde...
[ "public", "BoxFile", ".", "Info", "upload", "(", "BoxAPIConnection", "boxApi", ",", "String", "folderId", ",", "InputStream", "stream", ",", "URL", "url", ",", "String", "fileName", ",", "long", "fileSize", ")", "throws", "InterruptedException", ",", "IOExceptio...
Uploads a new large file. @param boxApi the API connection to be used by the upload session. @param folderId the id of the folder in which the file will be uploaded. @param stream the input stream that feeds the content of the file. @param url the upload session URL. @param fileName the name of the file to be created. ...
[ "Uploads", "a", "new", "large", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/LargeFileUpload.java#L91-L96
train
box/box-java-sdk
src/main/java/com/box/sdk/LargeFileUpload.java
LargeFileUpload.generateDigest
public String generateDigest(InputStream stream) { MessageDigest digest = null; try { digest = MessageDigest.getInstance(DIGEST_ALGORITHM_SHA1); } catch (NoSuchAlgorithmException ae) { throw new BoxAPIException("Digest algorithm not found", ae); } //Calcu...
java
public String generateDigest(InputStream stream) { MessageDigest digest = null; try { digest = MessageDigest.getInstance(DIGEST_ALGORITHM_SHA1); } catch (NoSuchAlgorithmException ae) { throw new BoxAPIException("Digest algorithm not found", ae); } //Calcu...
[ "public", "String", "generateDigest", "(", "InputStream", "stream", ")", "{", "MessageDigest", "digest", "=", "null", ";", "try", "{", "digest", "=", "MessageDigest", ".", "getInstance", "(", "DIGEST_ALGORITHM_SHA1", ")", ";", "}", "catch", "(", "NoSuchAlgorithm...
Generates the Base64 encoded SHA-1 hash for content available in the stream. It can be used to calculate the hash of a file. @param stream the input stream of the file or data. @return the Base64 encoded hash string.
[ "Generates", "the", "Base64", "encoded", "SHA", "-", "1", "hash", "for", "content", "available", "in", "the", "stream", ".", "It", "can", "be", "used", "to", "calculate", "the", "hash", "of", "a", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/LargeFileUpload.java#L220-L242
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSharedLink.java
BoxSharedLink.setPermissions
public void setPermissions(Permissions permissions) { if (this.permissions == permissions) { return; } this.removeChildObject("permissions"); this.permissions = permissions; this.addChildObject("permissions", permissions); }
java
public void setPermissions(Permissions permissions) { if (this.permissions == permissions) { return; } this.removeChildObject("permissions"); this.permissions = permissions; this.addChildObject("permissions", permissions); }
[ "public", "void", "setPermissions", "(", "Permissions", "permissions", ")", "{", "if", "(", "this", ".", "permissions", "==", "permissions", ")", "{", "return", ";", "}", "this", ".", "removeChildObject", "(", "\"permissions\"", ")", ";", "this", ".", "permi...
Sets the permissions associated with this shared link. @param permissions the new permissions for this shared link.
[ "Sets", "the", "permissions", "associated", "with", "this", "shared", "link", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSharedLink.java#L175-L183
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.deleteFolder
public void deleteFolder(String folderID) { URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
java
public void deleteFolder(String folderID) { URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
[ "public", "void", "deleteFolder", "(", "String", "folderID", ")", "{", "URL", "url", "=", "FOLDER_INFO_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "folderID", ")", ";", "BoxAPIRequest", "request", "=", "new", "Bo...
Permanently deletes a trashed folder. @param folderID the ID of the trashed folder to permanently delete.
[ "Permanently", "deletes", "a", "trashed", "folder", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L53-L58
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.getFolderInfo
public BoxFolder.Info getFolderInfo(String folderID) { URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObje...
java
public BoxFolder.Info getFolderInfo(String folderID) { URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObje...
[ "public", "BoxFolder", ".", "Info", "getFolderInfo", "(", "String", "folderID", ")", "{", "URL", "url", "=", "FOLDER_INFO_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "folderID", ")", ";", "BoxAPIRequest", "request"...
Gets information about a trashed folder. @param folderID the ID of the trashed folder. @return info about the trashed folder.
[ "Gets", "information", "about", "a", "trashed", "folder", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L65-L73
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.getFolderInfo
public BoxFolder.Info getFolderInfo(String folderID, String... fields) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); URL url = FOLDER_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, folderID); BoxAPIRequest request = new BoxAPIRequ...
java
public BoxFolder.Info getFolderInfo(String folderID, String... fields) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); URL url = FOLDER_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, folderID); BoxAPIRequest request = new BoxAPIRequ...
[ "public", "BoxFolder", ".", "Info", "getFolderInfo", "(", "String", "folderID", ",", "String", "...", "fields", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", "\"fields\"", ",", "fields", ")", ".", "to...
Gets information about a trashed folder that's limited to a list of specified fields. @param folderID the ID of the trashed folder. @param fields the fields to retrieve. @return info about the trashed folder containing only the specified fields.
[ "Gets", "information", "about", "a", "trashed", "folder", "that", "s", "limited", "to", "a", "list", "of", "specified", "fields", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L81-L90
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.restoreFolder
public BoxFolder.Info restoreFolder(String folderID) { URL url = RESTORE_FOLDER_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "POST"); JsonObject requestJSON = new JsonObject() .add("", ""); request.setBody(r...
java
public BoxFolder.Info restoreFolder(String folderID) { URL url = RESTORE_FOLDER_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "POST"); JsonObject requestJSON = new JsonObject() .add("", ""); request.setBody(r...
[ "public", "BoxFolder", ".", "Info", "restoreFolder", "(", "String", "folderID", ")", "{", "URL", "url", "=", "RESTORE_FOLDER_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "folderID", ")", ";", "BoxAPIRequest", "reque...
Restores a trashed folder back to its original location. @param folderID the ID of the trashed folder. @return info about the restored folder.
[ "Restores", "a", "trashed", "folder", "back", "to", "its", "original", "location", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L97-L108
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.restoreFolder
public BoxFolder.Info restoreFolder(String folderID, String newName, String newParentID) { JsonObject requestJSON = new JsonObject(); if (newName != null) { requestJSON.add("name", newName); } if (newParentID != null) { JsonObject parent = new JsonObject(); ...
java
public BoxFolder.Info restoreFolder(String folderID, String newName, String newParentID) { JsonObject requestJSON = new JsonObject(); if (newName != null) { requestJSON.add("name", newName); } if (newParentID != null) { JsonObject parent = new JsonObject(); ...
[ "public", "BoxFolder", ".", "Info", "restoreFolder", "(", "String", "folderID", ",", "String", "newName", ",", "String", "newParentID", ")", "{", "JsonObject", "requestJSON", "=", "new", "JsonObject", "(", ")", ";", "if", "(", "newName", "!=", "null", ")", ...
Restores a trashed folder to a new location with a new name. @param folderID the ID of the trashed folder. @param newName an optional new name to give the folder. This can be null to use the folder's original name. @param newParentID an optional new parent ID for the folder. This can be null to use the folder...
[ "Restores", "a", "trashed", "folder", "to", "a", "new", "location", "with", "a", "new", "name", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L118-L139
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.deleteFile
public void deleteFile(String fileID) { URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
java
public void deleteFile(String fileID) { URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
[ "public", "void", "deleteFile", "(", "String", "fileID", ")", "{", "URL", "url", "=", "FILE_INFO_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "fileID", ")", ";", "BoxAPIRequest", "request", "=", "new", "BoxAPIRequ...
Permanently deletes a trashed file. @param fileID the ID of the trashed folder to permanently delete.
[ "Permanently", "deletes", "a", "trashed", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L145-L150
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.getFileInfo
public BoxFile.Info getFileInfo(String fileID) { URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFro...
java
public BoxFile.Info getFileInfo(String fileID) { URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFro...
[ "public", "BoxFile", ".", "Info", "getFileInfo", "(", "String", "fileID", ")", "{", "URL", "url", "=", "FILE_INFO_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "fileID", ")", ";", "BoxAPIRequest", "request", "=", ...
Gets information about a trashed file. @param fileID the ID of the trashed file. @return info about the trashed file.
[ "Gets", "information", "about", "a", "trashed", "file", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L157-L165
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.getFileInfo
public BoxFile.Info getFileInfo(String fileID, String... fields) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); URL url = FILE_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, fileID); BoxAPIRequest request = new BoxAPIRequest(this.a...
java
public BoxFile.Info getFileInfo(String fileID, String... fields) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); URL url = FILE_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, fileID); BoxAPIRequest request = new BoxAPIRequest(this.a...
[ "public", "BoxFile", ".", "Info", "getFileInfo", "(", "String", "fileID", ",", "String", "...", "fields", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", "\"fields\"", ",", "fields", ")", ".", "toString...
Gets information about a trashed file that's limited to a list of specified fields. @param fileID the ID of the trashed file. @param fields the fields to retrieve. @return info about the trashed file containing only the specified fields.
[ "Gets", "information", "about", "a", "trashed", "file", "that", "s", "limited", "to", "a", "list", "of", "specified", "fields", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L173-L182
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.restoreFile
public BoxFile.Info restoreFile(String fileID) { URL url = RESTORE_FILE_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "POST"); JsonObject requestJSON = new JsonObject() .add("", ""); request.setBody(requestJSON...
java
public BoxFile.Info restoreFile(String fileID) { URL url = RESTORE_FILE_URL_TEMPLATE.build(this.api.getBaseURL(), fileID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "POST"); JsonObject requestJSON = new JsonObject() .add("", ""); request.setBody(requestJSON...
[ "public", "BoxFile", ".", "Info", "restoreFile", "(", "String", "fileID", ")", "{", "URL", "url", "=", "RESTORE_FILE_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "fileID", ")", ";", "BoxAPIRequest", "request", "="...
Restores a trashed file back to its original location. @param fileID the ID of the trashed file. @return info about the restored file.
[ "Restores", "a", "trashed", "file", "back", "to", "its", "original", "location", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L189-L200
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.restoreFile
public BoxFile.Info restoreFile(String fileID, String newName, String newParentID) { JsonObject requestJSON = new JsonObject(); if (newName != null) { requestJSON.add("name", newName); } if (newParentID != null) { JsonObject parent = new JsonObject(); ...
java
public BoxFile.Info restoreFile(String fileID, String newName, String newParentID) { JsonObject requestJSON = new JsonObject(); if (newName != null) { requestJSON.add("name", newName); } if (newParentID != null) { JsonObject parent = new JsonObject(); ...
[ "public", "BoxFile", ".", "Info", "restoreFile", "(", "String", "fileID", ",", "String", "newName", ",", "String", "newParentID", ")", "{", "JsonObject", "requestJSON", "=", "new", "JsonObject", "(", ")", ";", "if", "(", "newName", "!=", "null", ")", "{", ...
Restores a trashed file to a new location with a new name. @param fileID the ID of the trashed file. @param newName an optional new name to give the file. This can be null to use the file's original name. @param newParentID an optional new parent ID for the file. This can be null to use the file's original ...
[ "Restores", "a", "trashed", "file", "to", "a", "new", "location", "with", "a", "new", "name", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L210-L231
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.iterator
public Iterator<BoxItem.Info> iterator() { URL url = GET_ITEMS_URL.build(this.api.getBaseURL()); return new BoxItemIterator(this.api, url); }
java
public Iterator<BoxItem.Info> iterator() { URL url = GET_ITEMS_URL.build(this.api.getBaseURL()); return new BoxItemIterator(this.api, url); }
[ "public", "Iterator", "<", "BoxItem", ".", "Info", ">", "iterator", "(", ")", "{", "URL", "url", "=", "GET_ITEMS_URL", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ")", ";", "return", "new", "BoxItemIterator", "(", "this", ".", ...
Returns an iterator over the items in the trash. @return an iterator over the items in the trash.
[ "Returns", "an", "iterator", "over", "the", "items", "in", "the", "trash", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L237-L240
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.createMetadataTemplate
public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey, String displayName, boolean hidden, List<Field> fields) { JsonObject jsonObject = new JsonObject(); jsonObject.add("scope", scope); jsonObject.add("displayName", displayName...
java
public static MetadataTemplate createMetadataTemplate(BoxAPIConnection api, String scope, String templateKey, String displayName, boolean hidden, List<Field> fields) { JsonObject jsonObject = new JsonObject(); jsonObject.add("scope", scope); jsonObject.add("displayName", displayName...
[ "public", "static", "MetadataTemplate", "createMetadataTemplate", "(", "BoxAPIConnection", "api", ",", "String", "scope", ",", "String", "templateKey", ",", "String", "displayName", ",", "boolean", "hidden", ",", "List", "<", "Field", ">", "fields", ")", "{", "J...
Creates new metadata template. @param api the API connection to be used. @param scope the scope of the object. @param templateKey a unique identifier for the template. @param displayName the display name of the field. @param hidden whether this template is hidden in the UI. @param fields the ordered set of fields for t...
[ "Creates", "new", "metadata", "template", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L198-L229
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.getFieldJsonObject
private static JsonObject getFieldJsonObject(Field field) { JsonObject fieldObj = new JsonObject(); fieldObj.add("type", field.getType()); fieldObj.add("key", field.getKey()); fieldObj.add("displayName", field.getDisplayName()); String fieldDesc = field.getDescription(); ...
java
private static JsonObject getFieldJsonObject(Field field) { JsonObject fieldObj = new JsonObject(); fieldObj.add("type", field.getType()); fieldObj.add("key", field.getKey()); fieldObj.add("displayName", field.getDisplayName()); String fieldDesc = field.getDescription(); ...
[ "private", "static", "JsonObject", "getFieldJsonObject", "(", "Field", "field", ")", "{", "JsonObject", "fieldObj", "=", "new", "JsonObject", "(", ")", ";", "fieldObj", ".", "add", "(", "\"type\"", ",", "field", ".", "getType", "(", ")", ")", ";", "fieldOb...
Gets the JsonObject representation of the given field object. @param field represents a template field @return the json object
[ "Gets", "the", "JsonObject", "representation", "of", "the", "given", "field", "object", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L236-L265
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.updateMetadataTemplate
public static MetadataTemplate updateMetadataTemplate(BoxAPIConnection api, String scope, String template, List<FieldOperation> fieldOperations) { JsonArray array = new JsonArray(); for (FieldOperation fieldOperation : fieldOperations) { JsonObject jsonObject = getFieldOperatio...
java
public static MetadataTemplate updateMetadataTemplate(BoxAPIConnection api, String scope, String template, List<FieldOperation> fieldOperations) { JsonArray array = new JsonArray(); for (FieldOperation fieldOperation : fieldOperations) { JsonObject jsonObject = getFieldOperatio...
[ "public", "static", "MetadataTemplate", "updateMetadataTemplate", "(", "BoxAPIConnection", "api", ",", "String", "scope", ",", "String", "template", ",", "List", "<", "FieldOperation", ">", "fieldOperations", ")", "{", "JsonArray", "array", "=", "new", "JsonArray", ...
Updates the schema of an existing metadata template. @param api the API connection to be used @param scope the scope of the object @param template Unique identifier of the template @param fieldOperations the fields that needs to be updated / added in the template @return the updated metadata template
[ "Updates", "the", "schema", "of", "an", "existing", "metadata", "template", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L276-L295
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.deleteMetadataTemplate
public static void deleteMetadataTemplate(BoxAPIConnection api, String scope, String template) { URL url = METADATA_TEMPLATE_URL_TEMPLATE.build(api.getBaseURL(), scope, template); BoxJSONRequest request = new BoxJSONRequest(api, url, "DELETE"); request.send(); }
java
public static void deleteMetadataTemplate(BoxAPIConnection api, String scope, String template) { URL url = METADATA_TEMPLATE_URL_TEMPLATE.build(api.getBaseURL(), scope, template); BoxJSONRequest request = new BoxJSONRequest(api, url, "DELETE"); request.send(); }
[ "public", "static", "void", "deleteMetadataTemplate", "(", "BoxAPIConnection", "api", ",", "String", "scope", ",", "String", "template", ")", "{", "URL", "url", "=", "METADATA_TEMPLATE_URL_TEMPLATE", ".", "build", "(", "api", ".", "getBaseURL", "(", ")", ",", ...
Deletes the schema of an existing metadata template. @param api the API connection to be used @param scope the scope of the object @param template Unique identifier of the template
[ "Deletes", "the", "schema", "of", "an", "existing", "metadata", "template", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L304-L310
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.getFieldOperationJsonObject
private static JsonObject getFieldOperationJsonObject(FieldOperation fieldOperation) { JsonObject jsonObject = new JsonObject(); jsonObject.add("op", fieldOperation.getOp().toString()); String fieldKey = fieldOperation.getFieldKey(); if (fieldKey != null) { jsonObject.add("f...
java
private static JsonObject getFieldOperationJsonObject(FieldOperation fieldOperation) { JsonObject jsonObject = new JsonObject(); jsonObject.add("op", fieldOperation.getOp().toString()); String fieldKey = fieldOperation.getFieldKey(); if (fieldKey != null) { jsonObject.add("f...
[ "private", "static", "JsonObject", "getFieldOperationJsonObject", "(", "FieldOperation", "fieldOperation", ")", "{", "JsonObject", "jsonObject", "=", "new", "JsonObject", "(", ")", ";", "jsonObject", ".", "add", "(", "\"op\"", ",", "fieldOperation", ".", "getOp", ...
Gets the JsonObject representation of the Field Operation. @param fieldOperation represents the template update operation @return the json object
[ "Gets", "the", "JsonObject", "representation", "of", "the", "Field", "Operation", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L317-L397
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.getJsonArray
private static JsonArray getJsonArray(List<String> keys) { JsonArray array = new JsonArray(); for (String key : keys) { array.add(key); } return array; }
java
private static JsonArray getJsonArray(List<String> keys) { JsonArray array = new JsonArray(); for (String key : keys) { array.add(key); } return array; }
[ "private", "static", "JsonArray", "getJsonArray", "(", "List", "<", "String", ">", "keys", ")", "{", "JsonArray", "array", "=", "new", "JsonArray", "(", ")", ";", "for", "(", "String", "key", ":", "keys", ")", "{", "array", ".", "add", "(", "key", ")...
Gets the Json Array representation of the given list of strings. @param keys List of strings @return the JsonArray represents the list of keys
[ "Gets", "the", "Json", "Array", "representation", "of", "the", "given", "list", "of", "strings", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L404-L411
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataTemplate.java
MetadataTemplate.getMetadataTemplateByID
public static MetadataTemplate getMetadataTemplateByID(BoxAPIConnection api, String templateID) { URL url = METADATA_TEMPLATE_BY_ID_URL_TEMPLATE.build(api.getBaseURL(), templateID); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request....
java
public static MetadataTemplate getMetadataTemplateByID(BoxAPIConnection api, String templateID) { URL url = METADATA_TEMPLATE_BY_ID_URL_TEMPLATE.build(api.getBaseURL(), templateID); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request....
[ "public", "static", "MetadataTemplate", "getMetadataTemplateByID", "(", "BoxAPIConnection", "api", ",", "String", "templateID", ")", "{", "URL", "url", "=", "METADATA_TEMPLATE_BY_ID_URL_TEMPLATE", ".", "build", "(", "api", ".", "getBaseURL", "(", ")", ",", "template...
Geta the specified metadata template by its ID. @param api the API connection to be used. @param templateID the ID of the template to get. @return the metadata template object.
[ "Geta", "the", "specified", "metadata", "template", "by", "its", "ID", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataTemplate.java#L460-L466
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearchParameters.java
BoxSearchParameters.clearParameters
public boolean clearParameters() { this.query = null; this.fields = null; this.scope = null; this.fileExtensions = null; this.createdRange = null; this.updatedRange = null; this.sizeRange = null; this.ownerUserIds = null; this.ancestorFolderIds = n...
java
public boolean clearParameters() { this.query = null; this.fields = null; this.scope = null; this.fileExtensions = null; this.createdRange = null; this.updatedRange = null; this.sizeRange = null; this.ownerUserIds = null; this.ancestorFolderIds = n...
[ "public", "boolean", "clearParameters", "(", ")", "{", "this", ".", "query", "=", "null", ";", "this", ".", "fields", "=", "null", ";", "this", ".", "scope", "=", "null", ";", "this", ".", "fileExtensions", "=", "null", ";", "this", ".", "createdRange"...
Clears the Parameters before performing a new search. @return this.true;
[ "Clears", "the", "Parameters", "before", "performing", "a", "new", "search", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearchParameters.java#L47-L64
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearchParameters.java
BoxSearchParameters.isNullOrEmpty
private boolean isNullOrEmpty(Object paramValue) { boolean isNullOrEmpty = false; if (paramValue == null) { isNullOrEmpty = true; } if (paramValue instanceof String) { if (((String) paramValue).trim().equalsIgnoreCase("")) { isNullOrEmpty = true; ...
java
private boolean isNullOrEmpty(Object paramValue) { boolean isNullOrEmpty = false; if (paramValue == null) { isNullOrEmpty = true; } if (paramValue instanceof String) { if (((String) paramValue).trim().equalsIgnoreCase("")) { isNullOrEmpty = true; ...
[ "private", "boolean", "isNullOrEmpty", "(", "Object", "paramValue", ")", "{", "boolean", "isNullOrEmpty", "=", "false", ";", "if", "(", "paramValue", "==", "null", ")", "{", "isNullOrEmpty", "=", "true", ";", "}", "if", "(", "paramValue", "instanceof", "Stri...
Checks String to see if the parameter is null. @param paramValue Object that will be checked if null. @return this.true if the parameter that is being checked is not null
[ "Checks", "String", "to", "see", "if", "the", "parameter", "is", "null", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearchParameters.java#L285-L298
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearchParameters.java
BoxSearchParameters.formatBoxMetadataFilterRequest
private JsonArray formatBoxMetadataFilterRequest() { JsonArray boxMetadataFilterRequestArray = new JsonArray(); JsonObject boxMetadataFilter = new JsonObject() .add("templateKey", this.metadataFilter.getTemplateKey()) .add("scope", this.metadataFilter.getScope()) ...
java
private JsonArray formatBoxMetadataFilterRequest() { JsonArray boxMetadataFilterRequestArray = new JsonArray(); JsonObject boxMetadataFilter = new JsonObject() .add("templateKey", this.metadataFilter.getTemplateKey()) .add("scope", this.metadataFilter.getScope()) ...
[ "private", "JsonArray", "formatBoxMetadataFilterRequest", "(", ")", "{", "JsonArray", "boxMetadataFilterRequestArray", "=", "new", "JsonArray", "(", ")", ";", "JsonObject", "boxMetadataFilter", "=", "new", "JsonObject", "(", ")", ".", "add", "(", "\"templateKey\"", ...
Add BoxMetaDataFilter to the JsonArray boxMetadataFilterRequestArray. @param @param bmf accepts a filter that has templateKey, scope, and filters populated. @return JsonArray that is formated Json request
[ "Add", "BoxMetaDataFilter", "to", "the", "JsonArray", "boxMetadataFilterRequestArray", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearchParameters.java#L304-L314
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearchParameters.java
BoxSearchParameters.listToCSV
private String listToCSV(List<String> list) { String csvStr = ""; for (String item : list) { csvStr += "," + item; } return csvStr.length() > 1 ? csvStr.substring(1) : csvStr; }
java
private String listToCSV(List<String> list) { String csvStr = ""; for (String item : list) { csvStr += "," + item; } return csvStr.length() > 1 ? csvStr.substring(1) : csvStr; }
[ "private", "String", "listToCSV", "(", "List", "<", "String", ">", "list", ")", "{", "String", "csvStr", "=", "\"\"", ";", "for", "(", "String", "item", ":", "list", ")", "{", "csvStr", "+=", "\",\"", "+", "item", ";", "}", "return", "csvStr", ".", ...
Concat a List into a CSV String. @param list list to concat @return csv string
[ "Concat", "a", "List", "into", "a", "CSV", "String", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearchParameters.java#L321-L328
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearchParameters.java
BoxSearchParameters.getQueryParameters
public QueryStringBuilder getQueryParameters() { QueryStringBuilder builder = new QueryStringBuilder(); if (this.isNullOrEmpty(this.query) && this.metadataFilter == null) { throw new BoxAPIException( "BoxSearchParameters requires either a search query or Metadata filter to b...
java
public QueryStringBuilder getQueryParameters() { QueryStringBuilder builder = new QueryStringBuilder(); if (this.isNullOrEmpty(this.query) && this.metadataFilter == null) { throw new BoxAPIException( "BoxSearchParameters requires either a search query or Metadata filter to b...
[ "public", "QueryStringBuilder", "getQueryParameters", "(", ")", "{", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", "(", "this", ".", "isNullOrEmpty", "(", "this", ".", "query", ")", "&&", "this", ".", "metadataFilter", ...
Get the Query Paramaters to be used for search request. @return this.QueryStringBuilder.
[ "Get", "the", "Query", "Paramaters", "to", "be", "used", "for", "search", "request", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearchParameters.java#L333-L403
train
box/box-java-sdk
src/main/java/com/box/sdk/MetadataFieldFilter.java
MetadataFieldFilter.getJsonObject
public JsonObject getJsonObject() { JsonObject obj = new JsonObject(); obj.add("field", this.field); obj.add("value", this.value); return obj; }
java
public JsonObject getJsonObject() { JsonObject obj = new JsonObject(); obj.add("field", this.field); obj.add("value", this.value); return obj; }
[ "public", "JsonObject", "getJsonObject", "(", ")", "{", "JsonObject", "obj", "=", "new", "JsonObject", "(", ")", ";", "obj", ".", "add", "(", "\"field\"", ",", "this", ".", "field", ")", ";", "obj", ".", "add", "(", "\"value\"", ",", "this", ".", "va...
Get the JSON representation of the metadata field filter. @return the JSON object representing the filter.
[ "Get", "the", "JSON", "representation", "of", "the", "metadata", "field", "filter", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/MetadataFieldFilter.java#L40-L48
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.restore
public static BoxAPIConnection restore(String clientID, String clientSecret, String state) { BoxAPIConnection api = new BoxAPIConnection(clientID, clientSecret); api.restore(state); return api; }
java
public static BoxAPIConnection restore(String clientID, String clientSecret, String state) { BoxAPIConnection api = new BoxAPIConnection(clientID, clientSecret); api.restore(state); return api; }
[ "public", "static", "BoxAPIConnection", "restore", "(", "String", "clientID", ",", "String", "clientSecret", ",", "String", "state", ")", "{", "BoxAPIConnection", "api", "=", "new", "BoxAPIConnection", "(", "clientID", ",", "clientSecret", ")", ";", "api", ".", ...
Restores a BoxAPIConnection from a saved state. @see #save @param clientID the client ID to use with the connection. @param clientSecret the client secret to use with the connection. @param state the saved state that was created with {@link #save}. @return a restored API connection.
[ "Restores", "a", "BoxAPIConnection", "from", "a", "saved", "state", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L146-L150
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.getAuthorizationURL
public static URL getAuthorizationURL(String clientID, URI redirectUri, String state, List<String> scopes) { URLTemplate template = new URLTemplate(AUTHORIZATION_URL); QueryStringBuilder queryBuilder = new QueryStringBuilder().appendParam("client_id", clientID) .appendParam("response_typ...
java
public static URL getAuthorizationURL(String clientID, URI redirectUri, String state, List<String> scopes) { URLTemplate template = new URLTemplate(AUTHORIZATION_URL); QueryStringBuilder queryBuilder = new QueryStringBuilder().appendParam("client_id", clientID) .appendParam("response_typ...
[ "public", "static", "URL", "getAuthorizationURL", "(", "String", "clientID", ",", "URI", "redirectUri", ",", "String", "state", ",", "List", "<", "String", ">", "scopes", ")", "{", "URLTemplate", "template", "=", "new", "URLTemplate", "(", "AUTHORIZATION_URL", ...
Return the authorization URL which is used to perform the authorization_code based OAuth2 flow. @param clientID the client ID to use with the connection. @param redirectUri the URL to which Box redirects the browser when authentication completes. @param state the text string that you choose. Box sends the same string t...
[ "Return", "the", "authorization", "URL", "which", "is", "used", "to", "perform", "the", "authorization_code", "based", "OAuth2", "flow", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L162-L184
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.authenticate
public void authenticate(String authCode) { URL url = null; try { url = new URL(this.tokenURL); } catch (MalformedURLException e) { assert false : "An invalid token URL indicates a bug in the SDK."; throw new RuntimeException("An invalid token URL indicates a ...
java
public void authenticate(String authCode) { URL url = null; try { url = new URL(this.tokenURL); } catch (MalformedURLException e) { assert false : "An invalid token URL indicates a bug in the SDK."; throw new RuntimeException("An invalid token URL indicates a ...
[ "public", "void", "authenticate", "(", "String", "authCode", ")", "{", "URL", "url", "=", "null", ";", "try", "{", "url", "=", "new", "URL", "(", "this", ".", "tokenURL", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "assert", ...
Authenticates the API connection by obtaining access and refresh tokens using the auth code that was obtained from the first half of OAuth. @param authCode the auth code obtained from the first half of the OAuth process.
[ "Authenticates", "the", "API", "connection", "by", "obtaining", "access", "and", "refresh", "tokens", "using", "the", "auth", "code", "that", "was", "obtained", "from", "the", "first", "half", "of", "OAuth", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L191-L215
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.needsRefresh
public boolean needsRefresh() { boolean needsRefresh; this.refreshLock.readLock().lock(); long now = System.currentTimeMillis(); long tokenDuration = (now - this.lastRefresh); needsRefresh = (tokenDuration >= this.expires - REFRESH_EPSILON); this.refreshLock.readLock().u...
java
public boolean needsRefresh() { boolean needsRefresh; this.refreshLock.readLock().lock(); long now = System.currentTimeMillis(); long tokenDuration = (now - this.lastRefresh); needsRefresh = (tokenDuration >= this.expires - REFRESH_EPSILON); this.refreshLock.readLock().u...
[ "public", "boolean", "needsRefresh", "(", ")", "{", "boolean", "needsRefresh", ";", "this", ".", "refreshLock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "tokenDu...
Determines if this connection's access token has expired and needs to be refreshed. @return true if the access token needs to be refreshed; otherwise false.
[ "Determines", "if", "this", "connection", "s", "access", "token", "has", "expired", "and", "needs", "to", "be", "refreshed", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L530-L540
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.refresh
public void refresh() { this.refreshLock.writeLock().lock(); if (!this.canRefresh()) { this.refreshLock.writeLock().unlock(); throw new IllegalStateException("The BoxAPIConnection cannot be refreshed because it doesn't have a " + "refresh token."); } ...
java
public void refresh() { this.refreshLock.writeLock().lock(); if (!this.canRefresh()) { this.refreshLock.writeLock().unlock(); throw new IllegalStateException("The BoxAPIConnection cannot be refreshed because it doesn't have a " + "refresh token."); } ...
[ "public", "void", "refresh", "(", ")", "{", "this", ".", "refreshLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "if", "(", "!", "this", ".", "canRefresh", "(", ")", ")", "{", "this", ".", "refreshLock", ".", "writeLock", "(", ")", ...
Refresh's this connection's access token using its refresh token. @throws IllegalStateException if this connection's access token cannot be refreshed.
[ "Refresh", "s", "this", "connection", "s", "access", "token", "using", "its", "refresh", "token", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L546-L590
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.restore
public void restore(String state) { JsonObject json = JsonObject.readFrom(state); String accessToken = json.get("accessToken").asString(); String refreshToken = json.get("refreshToken").asString(); long lastRefresh = json.get("lastRefresh").asLong(); long expires = json.get("expi...
java
public void restore(String state) { JsonObject json = JsonObject.readFrom(state); String accessToken = json.get("accessToken").asString(); String refreshToken = json.get("refreshToken").asString(); long lastRefresh = json.get("lastRefresh").asLong(); long expires = json.get("expi...
[ "public", "void", "restore", "(", "String", "state", ")", "{", "JsonObject", "json", "=", "JsonObject", ".", "readFrom", "(", "state", ")", ";", "String", "accessToken", "=", "json", ".", "get", "(", "\"accessToken\"", ")", ".", "asString", "(", ")", ";"...
Restores a saved connection state into this BoxAPIConnection. @see #save @param state the saved state that was created with {@link #save}.
[ "Restores", "a", "saved", "connection", "state", "into", "this", "BoxAPIConnection", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L598-L621
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.getLowerScopedToken
public ScopedToken getLowerScopedToken(List<String> scopes, String resource) { assert (scopes != null); assert (scopes.size() > 0); URL url = null; try { url = new URL(this.getTokenURL()); } catch (MalformedURLException e) { assert false : "An invalid refr...
java
public ScopedToken getLowerScopedToken(List<String> scopes, String resource) { assert (scopes != null); assert (scopes.size() > 0); URL url = null; try { url = new URL(this.getTokenURL()); } catch (MalformedURLException e) { assert false : "An invalid refr...
[ "public", "ScopedToken", "getLowerScopedToken", "(", "List", "<", "String", ">", "scopes", ",", "String", "resource", ")", "{", "assert", "(", "scopes", "!=", "null", ")", ";", "assert", "(", "scopes", ".", "size", "(", ")", ">", "0", ")", ";", "URL", ...
Get a lower-scoped token restricted to a resource for the list of scopes that are passed. @param scopes the list of scopes to which the new token should be restricted for @param resource the resource for which the new token has to be obtained @return scopedToken which has access token and other details
[ "Get", "a", "lower", "-", "scoped", "token", "restricted", "to", "a", "resource", "for", "the", "list", "of", "scopes", "that", "are", "passed", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L680-L733
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIConnection.java
BoxAPIConnection.save
public String save() { JsonObject state = new JsonObject() .add("accessToken", this.accessToken) .add("refreshToken", this.refreshToken) .add("lastRefresh", this.lastRefresh) .add("expires", this.expires) .add("userAgent", this.userAgent) ....
java
public String save() { JsonObject state = new JsonObject() .add("accessToken", this.accessToken) .add("refreshToken", this.refreshToken) .add("lastRefresh", this.lastRefresh) .add("expires", this.expires) .add("userAgent", this.userAgent) ....
[ "public", "String", "save", "(", ")", "{", "JsonObject", "state", "=", "new", "JsonObject", "(", ")", ".", "add", "(", "\"accessToken\"", ",", "this", ".", "accessToken", ")", ".", "add", "(", "\"refreshToken\"", ",", "this", ".", "refreshToken", ")", "....
Saves the state of this connection to a string so that it can be persisted and restored at a later time. <p>Note that proxy settings aren't automatically saved or restored. This is mainly due to security concerns around persisting proxy authentication details to the state string. If your connection uses a proxy, you w...
[ "Saves", "the", "state", "of", "this", "connection", "to", "a", "string", "so", "that", "it", "can", "be", "persisted", "and", "restored", "at", "a", "later", "time", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L773-L786
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxDevicePin.java
BoxDevicePin.getInfo
public Info getInfo(String ... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = DEVICE_PIN_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), builder.toString(), this.getID()...
java
public Info getInfo(String ... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = DEVICE_PIN_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), builder.toString(), this.getID()...
[ "public", "Info", "getInfo", "(", "String", "...", "fields", ")", "{", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", "(", "fields", ".", "length", ">", "0", ")", "{", "builder", ".", "appendParam", "(", "\"fields\"...
Gets information about the device pin. @param fields the fields to retrieve. @return info about the device pin.
[ "Gets", "information", "about", "the", "device", "pin", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDevicePin.java#L50-L60
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxDevicePin.java
BoxDevicePin.delete
public void delete() { URL url = DEVICE_PIN_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
java
public void delete() { URL url = DEVICE_PIN_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
[ "public", "void", "delete", "(", ")", "{", "URL", "url", "=", "DEVICE_PIN_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", ";", "BoxAPIRequest", "request", "=", ...
Deletes the device pin.
[ "Deletes", "the", "device", "pin", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDevicePin.java#L105-L110
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxMetadataCascadePolicy.java
BoxMetadataCascadePolicy.forceApply
public void forceApply(String conflictResolution) { URL url = FORCE_METADATA_CASCADE_POLICIES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); JsonObject requestJSON = new JsonObject() .add("co...
java
public void forceApply(String conflictResolution) { URL url = FORCE_METADATA_CASCADE_POLICIES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); JsonObject requestJSON = new JsonObject() .add("co...
[ "public", "void", "forceApply", "(", "String", "conflictResolution", ")", "{", "URL", "url", "=", "FORCE_METADATA_CASCADE_POLICIES_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ...
If a policy already exists on a folder, this will apply that policy to all existing files and sub folders within the target folder. @param conflictResolution the desired behavior for conflict-resolution. Set to either none or overwrite.
[ "If", "a", "policy", "already", "exists", "on", "a", "folder", "this", "will", "apply", "that", "policy", "to", "all", "existing", "files", "and", "sub", "folders", "within", "the", "target", "folder", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxMetadataCascadePolicy.java#L141-L149
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTask.java
BoxTask.addAssignment
public BoxTaskAssignment.Info addAssignment(BoxUser assignTo) { JsonObject taskJSON = new JsonObject(); taskJSON.add("type", "task"); taskJSON.add("id", this.getID()); JsonObject assignToJSON = new JsonObject(); assignToJSON.add("id", assignTo.getID()); JsonObject reque...
java
public BoxTaskAssignment.Info addAssignment(BoxUser assignTo) { JsonObject taskJSON = new JsonObject(); taskJSON.add("type", "task"); taskJSON.add("id", this.getID()); JsonObject assignToJSON = new JsonObject(); assignToJSON.add("id", assignTo.getID()); JsonObject reque...
[ "public", "BoxTaskAssignment", ".", "Info", "addAssignment", "(", "BoxUser", "assignTo", ")", "{", "JsonObject", "taskJSON", "=", "new", "JsonObject", "(", ")", ";", "taskJSON", ".", "add", "(", "\"type\"", ",", "\"task\"", ")", ";", "taskJSON", ".", "add", ...
Adds a new assignment to this task. @param assignTo the user to assign the assignment to. @return information about the newly added task assignment.
[ "Adds", "a", "new", "assignment", "to", "this", "task", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTask.java#L57-L77
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTask.java
BoxTask.getAssignments
public List<BoxTaskAssignment.Info> getAssignments() { URL url = GET_ASSIGNMENTS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject res...
java
public List<BoxTaskAssignment.Info> getAssignments() { URL url = GET_ASSIGNMENTS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject res...
[ "public", "List", "<", "BoxTaskAssignment", ".", "Info", ">", "getAssignments", "(", ")", "{", "URL", "url", "=", "GET_ASSIGNMENTS_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", ...
Gets any assignments for this task. @return a list of assignments for this task.
[ "Gets", "any", "assignments", "for", "this", "task", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTask.java#L110-L127
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTask.java
BoxTask.getAllAssignments
public Iterable<BoxTaskAssignment.Info> getAllAssignments(String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxTaskAssignment.Info>() { public Ite...
java
public Iterable<BoxTaskAssignment.Info> getAllAssignments(String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxTaskAssignment.Info>() { public Ite...
[ "public", "Iterable", "<", "BoxTaskAssignment", ".", "Info", ">", "getAllAssignments", "(", "String", "...", "fields", ")", "{", "final", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", "(", "fields", ".", "length", ">",...
Gets an iterable of all the assignments of this task. @param fields the fields to retrieve. @return an iterable containing info about all the assignments.
[ "Gets", "an", "iterable", "of", "all", "the", "assignments", "of", "this", "task", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTask.java#L134-L146
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxJSONObject.java
BoxJSONObject.getPendingChanges
public String getPendingChanges() { JsonObject jsonObject = this.getPendingJSONObject(); if (jsonObject == null) { return null; } return jsonObject.toString(); }
java
public String getPendingChanges() { JsonObject jsonObject = this.getPendingJSONObject(); if (jsonObject == null) { return null; } return jsonObject.toString(); }
[ "public", "String", "getPendingChanges", "(", ")", "{", "JsonObject", "jsonObject", "=", "this", ".", "getPendingJSONObject", "(", ")", ";", "if", "(", "jsonObject", "==", "null", ")", "{", "return", "null", ";", "}", "return", "jsonObject", ".", "toString",...
Gets a JSON string containing any pending changes to this object that can be sent back to the Box API. @return a JSON string containing the pending changes.
[ "Gets", "a", "JSON", "string", "containing", "any", "pending", "changes", "to", "this", "object", "that", "can", "be", "sent", "back", "to", "the", "Box", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L66-L73
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxJSONObject.java
BoxJSONObject.update
void update(JsonObject jsonObject) { for (JsonObject.Member member : jsonObject) { if (member.getValue().isNull()) { continue; } this.parseJSONMember(member); } this.clearPendingChanges(); }
java
void update(JsonObject jsonObject) { for (JsonObject.Member member : jsonObject) { if (member.getValue().isNull()) { continue; } this.parseJSONMember(member); } this.clearPendingChanges(); }
[ "void", "update", "(", "JsonObject", "jsonObject", ")", "{", "for", "(", "JsonObject", ".", "Member", "member", ":", "jsonObject", ")", "{", "if", "(", "member", ".", "getValue", "(", ")", ".", "isNull", "(", ")", ")", "{", "continue", ";", "}", "thi...
Updates this BoxJSONObject using the information in a JSON object. @param jsonObject the JSON object containing updated information.
[ "Updates", "this", "BoxJSONObject", "using", "the", "information", "in", "a", "JSON", "object", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L187-L197
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxJSONObject.java
BoxJSONObject.getPendingJSONObject
private JsonObject getPendingJSONObject() { for (Map.Entry<String, BoxJSONObject> entry : this.children.entrySet()) { BoxJSONObject child = entry.getValue(); JsonObject jsonObject = child.getPendingJSONObject(); if (jsonObject != null) { if (this.pendingChange...
java
private JsonObject getPendingJSONObject() { for (Map.Entry<String, BoxJSONObject> entry : this.children.entrySet()) { BoxJSONObject child = entry.getValue(); JsonObject jsonObject = child.getPendingJSONObject(); if (jsonObject != null) { if (this.pendingChange...
[ "private", "JsonObject", "getPendingJSONObject", "(", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "BoxJSONObject", ">", "entry", ":", "this", ".", "children", ".", "entrySet", "(", ")", ")", "{", "BoxJSONObject", "child", "=", "entry", ...
Gets a JsonObject containing any pending changes to this object that can be sent back to the Box API. @return a JsonObject containing the pending changes.
[ "Gets", "a", "JsonObject", "containing", "any", "pending", "changes", "to", "this", "object", "that", "can", "be", "sent", "back", "to", "the", "Box", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L203-L216
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIRequest.java
BoxAPIRequest.addHeader
public void addHeader(String key, String value) { if (key.equals("As-User")) { for (int i = 0; i < this.headers.size(); i++) { if (this.headers.get(i).getKey().equals("As-User")) { this.headers.remove(i); } } } if (key.e...
java
public void addHeader(String key, String value) { if (key.equals("As-User")) { for (int i = 0; i < this.headers.size(); i++) { if (this.headers.get(i).getKey().equals("As-User")) { this.headers.remove(i); } } } if (key.e...
[ "public", "void", "addHeader", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "key", ".", "equals", "(", "\"As-User\"", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "headers", ".", "size", "(", ...
Adds an HTTP header to this request. @param key the header key. @param value the header value.
[ "Adds", "an", "HTTP", "header", "to", "this", "request", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L178-L190
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIRequest.java
BoxAPIRequest.setBody
public void setBody(String body) { byte[] bytes = body.getBytes(StandardCharsets.UTF_8); this.bodyLength = bytes.length; this.body = new ByteArrayInputStream(bytes); }
java
public void setBody(String body) { byte[] bytes = body.getBytes(StandardCharsets.UTF_8); this.bodyLength = bytes.length; this.body = new ByteArrayInputStream(bytes); }
[ "public", "void", "setBody", "(", "String", "body", ")", "{", "byte", "[", "]", "bytes", "=", "body", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ";", "this", ".", "bodyLength", "=", "bytes", ".", "length", ";", "this", ".", "body", ...
Sets the request body to the contents of a String. <p>If the contents of the body are large, then it may be more efficient to use an {@link InputStream} instead of a String. Using a String requires that the entire body be in memory before sending the request.</p> @param body a String containing the contents of the bo...
[ "Sets", "the", "request", "body", "to", "the", "contents", "of", "a", "String", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L280-L284
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIRequest.java
BoxAPIRequest.send
public BoxAPIResponse send(ProgressListener listener) { if (this.api == null) { this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts()); } else { this.backoffCounter.reset(this.api.getMaxRequestAttempts()); } while (this.backoffCounter.getAttemptsRem...
java
public BoxAPIResponse send(ProgressListener listener) { if (this.api == null) { this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts()); } else { this.backoffCounter.reset(this.api.getMaxRequestAttempts()); } while (this.backoffCounter.getAttemptsRem...
[ "public", "BoxAPIResponse", "send", "(", "ProgressListener", "listener", ")", "{", "if", "(", "this", ".", "api", "==", "null", ")", "{", "this", ".", "backoffCounter", ".", "reset", "(", "BoxGlobalSettings", ".", "getMaxRequestAttempts", "(", ")", ")", ";",...
Sends this request while monitoring its progress and returns a BoxAPIResponse containing the server's response. <p>A ProgressListener is generally only useful when the size of the request is known beforehand. If the size is unknown, then the ProgressListener will be updated for each byte sent, but the total number of ...
[ "Sends", "this", "request", "while", "monitoring", "its", "progress", "and", "returns", "a", "BoxAPIResponse", "containing", "the", "server", "s", "response", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L345-L376
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIRequest.java
BoxAPIRequest.writeBody
protected void writeBody(HttpURLConnection connection, ProgressListener listener) { if (this.body == null) { return; } connection.setDoOutput(true); try { OutputStream output = connection.getOutputStream(); if (listener != null) { outp...
java
protected void writeBody(HttpURLConnection connection, ProgressListener listener) { if (this.body == null) { return; } connection.setDoOutput(true); try { OutputStream output = connection.getOutputStream(); if (listener != null) { outp...
[ "protected", "void", "writeBody", "(", "HttpURLConnection", "connection", ",", "ProgressListener", "listener", ")", "{", "if", "(", "this", ".", "body", "==", "null", ")", "{", "return", ";", "}", "connection", ".", "setDoOutput", "(", "true", ")", ";", "t...
Writes the body of this request to an HttpURLConnection. <p>Subclasses overriding this method must remember to close the connection's OutputStream after writing.</p> @param connection the connection to which the body should be written. @param listener an optional listener for monitoring the write progress. @throws ...
[ "Writes", "the", "body", "of", "this", "request", "to", "an", "HttpURLConnection", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L450-L470
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxLegalHoldPolicy.java
BoxLegalHoldPolicy.createOngoing
public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description) { URL url = ALL_LEGAL_HOLD_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, "POST"); JsonObject requestJSON = new JsonObject() .ad...
java
public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description) { URL url = ALL_LEGAL_HOLD_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, "POST"); JsonObject requestJSON = new JsonObject() .ad...
[ "public", "static", "BoxLegalHoldPolicy", ".", "Info", "createOngoing", "(", "BoxAPIConnection", "api", ",", "String", "name", ",", "String", "description", ")", "{", "URL", "url", "=", "ALL_LEGAL_HOLD_URL_TEMPLATE", ".", "build", "(", "api", ".", "getBaseURL", ...
Creates a new ongoing Legal Hold Policy. @param api the API connection to be used by the resource. @param name the name of Legal Hold Policy. @param description the description of Legal Hold Policy. @return information about the Legal Hold Policy created.
[ "Creates", "a", "new", "ongoing", "Legal", "Hold", "Policy", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L116-L130
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxLegalHoldPolicy.java
BoxLegalHoldPolicy.getAssignments
public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) { return this.getAssignments(null, null, DEFAULT_LIMIT, fields); }
java
public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) { return this.getAssignments(null, null, DEFAULT_LIMIT, fields); }
[ "public", "Iterable", "<", "BoxLegalHoldAssignment", ".", "Info", ">", "getAssignments", "(", "String", "...", "fields", ")", "{", "return", "this", ".", "getAssignments", "(", "null", ",", "null", ",", "DEFAULT_LIMIT", ",", "fields", ")", ";", "}" ]
Returns iterable containing assignments for this single legal hold policy. @param fields the fields to retrieve. @return an iterable containing assignments for this single legal hold policy.
[ "Returns", "iterable", "containing", "assignments", "for", "this", "single", "legal", "hold", "policy", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L210-L212
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxLegalHoldPolicy.java
BoxLegalHoldPolicy.getAssignments
public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String type, String id, int limit, String ... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (type != null) { builder.appendParam("assign_to_type", type); } if (id != null) { builder....
java
public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String type, String id, int limit, String ... fields) { QueryStringBuilder builder = new QueryStringBuilder(); if (type != null) { builder.appendParam("assign_to_type", type); } if (id != null) { builder....
[ "public", "Iterable", "<", "BoxLegalHoldAssignment", ".", "Info", ">", "getAssignments", "(", "String", "type", ",", "String", "id", ",", "int", "limit", ",", "String", "...", "fields", ")", "{", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder",...
Returns iterable containing assignments for this single legal hold policy. Parameters can be used to filter retrieved assignments. @param type filter assignments of this type only. Can be "file_version", "file", "folder", "user" or null if no type filter is necessary. @param id filter assignments to this ID only. Can b...
[ "Returns", "iterable", "containing", "assignments", "for", "this", "single", "legal", "hold", "policy", ".", "Parameters", "can", "be", "used", "to", "filter", "retrieved", "assignments", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L224-L246
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxLegalHoldPolicy.java
BoxLegalHoldPolicy.getFileVersionHolds
public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(int limit, String ... fields) { QueryStringBuilder queryString = new QueryStringBuilder().appendParam("policy_id", this.getID()); if (fields.length > 0) { queryString.appendParam("fields", fields); } URL url = ...
java
public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(int limit, String ... fields) { QueryStringBuilder queryString = new QueryStringBuilder().appendParam("policy_id", this.getID()); if (fields.length > 0) { queryString.appendParam("fields", fields); } URL url = ...
[ "public", "Iterable", "<", "BoxFileVersionLegalHold", ".", "Info", ">", "getFileVersionHolds", "(", "int", "limit", ",", "String", "...", "fields", ")", "{", "QueryStringBuilder", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", ...
Returns iterable with all non-deleted file version legal holds for this legal hold policy. @param limit the limit of entries per response. The default value is 100. @param fields the fields to retrieve. @return an iterable containing file version legal holds info.
[ "Returns", "iterable", "with", "all", "non", "-", "deleted", "file", "version", "legal", "holds", "for", "this", "legal", "hold", "policy", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L263-L279
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersionRetention.java
BoxFileVersionRetention.getAll
public static Iterable<BoxFileVersionRetention.Info> getAll(BoxAPIConnection api, String ... fields) { return getRetentions(api, new QueryFilter(), fields); }
java
public static Iterable<BoxFileVersionRetention.Info> getAll(BoxAPIConnection api, String ... fields) { return getRetentions(api, new QueryFilter(), fields); }
[ "public", "static", "Iterable", "<", "BoxFileVersionRetention", ".", "Info", ">", "getAll", "(", "BoxAPIConnection", "api", ",", "String", "...", "fields", ")", "{", "return", "getRetentions", "(", "api", ",", "new", "QueryFilter", "(", ")", ",", "fields", "...
Retrieves all file version retentions. @param api the API connection to be used by the resource. @param fields the fields to retrieve. @return an iterable contains information about all file version retentions.
[ "Retrieves", "all", "file", "version", "retentions", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L72-L74
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersionRetention.java
BoxFileVersionRetention.getRetentions
public static Iterable<BoxFileVersionRetention.Info> getRetentions( final BoxAPIConnection api, QueryFilter filter, String ... fields) { filter.addFields(fields); return new BoxResourceIterable<BoxFileVersionRetention.Info>(api, ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api....
java
public static Iterable<BoxFileVersionRetention.Info> getRetentions( final BoxAPIConnection api, QueryFilter filter, String ... fields) { filter.addFields(fields); return new BoxResourceIterable<BoxFileVersionRetention.Info>(api, ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api....
[ "public", "static", "Iterable", "<", "BoxFileVersionRetention", ".", "Info", ">", "getRetentions", "(", "final", "BoxAPIConnection", "api", ",", "QueryFilter", "filter", ",", "String", "...", "fields", ")", "{", "filter", ".", "addFields", "(", "fields", ")", ...
Retrieves all file version retentions matching given filters as an Iterable. @param api the API connection to be used by the resource. @param filter filters for the query stored in QueryFilter object. @param fields the fields to retrieve. @return an iterable contains information about all file version retentions matchi...
[ "Retrieves", "all", "file", "version", "retentions", "matching", "given", "filters", "as", "an", "Iterable", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L83-L96
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java
BoxWebHookSignatureVerifier.verify
public boolean verify(String signatureVersion, String signatureAlgorithm, String primarySignature, String secondarySignature, String webHookPayload, String deliveryTimestamp) { // enforce versions supported by this implementation if (!SUPPORTED_VERSIONS.contains(signatureVersion)) { ...
java
public boolean verify(String signatureVersion, String signatureAlgorithm, String primarySignature, String secondarySignature, String webHookPayload, String deliveryTimestamp) { // enforce versions supported by this implementation if (!SUPPORTED_VERSIONS.contains(signatureVersion)) { ...
[ "public", "boolean", "verify", "(", "String", "signatureVersion", ",", "String", "signatureAlgorithm", ",", "String", "primarySignature", ",", "String", "secondarySignature", ",", "String", "webHookPayload", ",", "String", "deliveryTimestamp", ")", "{", "// enforce vers...
Verifies given web-hook information. @param signatureVersion signature version received from web-hook @param signatureAlgorithm signature algorithm received from web-hook @param primarySignature primary signature received from web-hook @param secondarySignature secondary signature received from web-hook @param webHook...
[ "Verifies", "given", "web", "-", "hook", "information", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java#L93-L121
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java
BoxWebHookSignatureVerifier.verify
private boolean verify(String key, BoxSignatureAlgorithm actualAlgorithm, String actualSignature, String webHookPayload, String deliveryTimestamp) { if (actualSignature == null) { return false; } byte[] actual = Base64.decode(actualSignature); byte[] expected = t...
java
private boolean verify(String key, BoxSignatureAlgorithm actualAlgorithm, String actualSignature, String webHookPayload, String deliveryTimestamp) { if (actualSignature == null) { return false; } byte[] actual = Base64.decode(actualSignature); byte[] expected = t...
[ "private", "boolean", "verify", "(", "String", "key", ",", "BoxSignatureAlgorithm", "actualAlgorithm", ",", "String", "actualSignature", ",", "String", "webHookPayload", ",", "String", "deliveryTimestamp", ")", "{", "if", "(", "actualSignature", "==", "null", ")", ...
Verifies a provided signature. @param key for which signature key @param actualAlgorithm current signature algorithm @param actualSignature current signature @param webHookPayload for signing @param deliveryTimestamp for signing @return true if verification passed
[ "Verifies", "a", "provided", "signature", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java#L138-L148
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxSearch.java
BoxSearch.searchRange
public PartialCollection<BoxItem.Info> searchRange(long offset, long limit, final BoxSearchParameters bsp) { QueryStringBuilder builder = bsp.getQueryParameters() .appendParam("limit", limit) .appendParam("offset", offset); URL url = SEARCH_URL_TEMPLATE.buildWithQuery(thi...
java
public PartialCollection<BoxItem.Info> searchRange(long offset, long limit, final BoxSearchParameters bsp) { QueryStringBuilder builder = bsp.getQueryParameters() .appendParam("limit", limit) .appendParam("offset", offset); URL url = SEARCH_URL_TEMPLATE.buildWithQuery(thi...
[ "public", "PartialCollection", "<", "BoxItem", ".", "Info", ">", "searchRange", "(", "long", "offset", ",", "long", "limit", ",", "final", "BoxSearchParameters", "bsp", ")", "{", "QueryStringBuilder", "builder", "=", "bsp", ".", "getQueryParameters", "(", ")", ...
Searches all descendant folders using a given query and query parameters. @param offset is the starting position. @param limit the maximum number of items to return. The default is 30 and the maximum is 200. @param bsp containing query and advanced search capabilities. @return a PartialCollection containing the sear...
[ "Searches", "all", "descendant", "folders", "using", "a", "given", "query", "and", "query", "parameters", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearch.java#L38-L58
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java
BoxTransactionalAPIConnection.getTransactionConnection
public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) { return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null); }
java
public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) { return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null); }
[ "public", "static", "BoxAPIConnection", "getTransactionConnection", "(", "String", "accessToken", ",", "String", "scope", ")", "{", "return", "BoxTransactionalAPIConnection", ".", "getTransactionConnection", "(", "accessToken", ",", "scope", ",", "null", ")", ";", "}"...
Request a scoped transactional token. @param accessToken application access token. @param scope scope of transactional token. @return a BoxAPIConnection which can be used to perform transactional requests.
[ "Request", "a", "scoped", "transactional", "token", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L35-L37
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java
BoxTransactionalAPIConnection.getTransactionConnection
public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) { BoxAPIConnection apiConnection = new BoxAPIConnection(accessToken); URL url; try { url = new URL(apiConnection.getTokenURL()); } catch (MalformedURLException e) { ...
java
public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) { BoxAPIConnection apiConnection = new BoxAPIConnection(accessToken); URL url; try { url = new URL(apiConnection.getTokenURL()); } catch (MalformedURLException e) { ...
[ "public", "static", "BoxAPIConnection", "getTransactionConnection", "(", "String", "accessToken", ",", "String", "scope", ",", "String", "resource", ")", "{", "BoxAPIConnection", "apiConnection", "=", "new", "BoxAPIConnection", "(", "accessToken", ")", ";", "URL", "...
Request a scoped transactional token for a particular resource. @param accessToken application access token. @param scope scope of transactional token. @param resource resource transactional token has access to. @return a BoxAPIConnection which can be used to perform transactional requests.
[ "Request", "a", "scoped", "transactional", "token", "for", "a", "particular", "resource", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L46-L83
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxItem.java
BoxItem.getSharedItem
public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink) { return getSharedItem(api, sharedLink, null); }
java
public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink) { return getSharedItem(api, sharedLink, null); }
[ "public", "static", "BoxItem", ".", "Info", "getSharedItem", "(", "BoxAPIConnection", "api", ",", "String", "sharedLink", ")", "{", "return", "getSharedItem", "(", "api", ",", "sharedLink", ",", "null", ")", ";", "}" ]
Gets an item that was shared with a shared link. @param api the API connection to be used by the shared item. @param sharedLink the shared link to the item. @return info about the shared item.
[ "Gets", "an", "item", "that", "was", "shared", "with", "a", "shared", "link", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L60-L62
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxItem.java
BoxItem.getSharedItem
public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) { BoxAPIConnection newAPI = new SharedLinkAPIConnection(api, sharedLink, password); URL url = SHARED_ITEM_URL_TEMPLATE.build(newAPI.getBaseURL()); BoxAPIRequest request = new BoxAPIRequest(newAPI, ...
java
public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) { BoxAPIConnection newAPI = new SharedLinkAPIConnection(api, sharedLink, password); URL url = SHARED_ITEM_URL_TEMPLATE.build(newAPI.getBaseURL()); BoxAPIRequest request = new BoxAPIRequest(newAPI, ...
[ "public", "static", "BoxItem", ".", "Info", "getSharedItem", "(", "BoxAPIConnection", "api", ",", "String", "sharedLink", ",", "String", "password", ")", "{", "BoxAPIConnection", "newAPI", "=", "new", "SharedLinkAPIConnection", "(", "api", ",", "sharedLink", ",", ...
Gets an item that was shared with a password-protected shared link. @param api the API connection to be used by the shared item. @param sharedLink the shared link to the item. @param password the password for the shared link. @return info about the shared item.
[ "Gets", "an", "item", "that", "was", "shared", "with", "a", "password", "-", "protected", "shared", "link", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L71-L78
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxItem.java
BoxItem.getWatermark
protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } ...
java
protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } ...
[ "protected", "BoxWatermark", "getWatermark", "(", "URLTemplate", "itemUrl", ",", "String", "...", "fields", ")", "{", "URL", "watermarkUrl", "=", "itemUrl", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", ...
Used to retrieve the watermark for the item. If the item does not have a watermark applied to it, a 404 Not Found will be returned by API. @param itemUrl url template for the item. @param fields the fields to retrieve. @return the watermark associated with the item.
[ "Used", "to", "retrieve", "the", "watermark", "for", "the", "item", ".", "If", "the", "item", "does", "not", "have", "a", "watermark", "applied", "to", "it", "a", "404", "Not", "Found", "will", "be", "returned", "by", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L87-L97
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxItem.java
BoxItem.applyWatermark
protected BoxWatermark applyWatermark(URLTemplate itemUrl, String imprint) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); ...
java
protected BoxWatermark applyWatermark(URLTemplate itemUrl, String imprint) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); ...
[ "protected", "BoxWatermark", "applyWatermark", "(", "URLTemplate", "itemUrl", ",", "String", "imprint", ")", "{", "URL", "watermarkUrl", "=", "itemUrl", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "get...
Used to apply or update the watermark for the item. @param itemUrl url template for the item. @param imprint the value must be "default", as custom watermarks is not yet supported. @return the watermark associated with the item.
[ "Used", "to", "apply", "or", "update", "the", "watermark", "for", "the", "item", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L105-L115
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxItem.java
BoxItem.removeWatermark
protected void removeWatermark(URLTemplate itemUrl) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse respo...
java
protected void removeWatermark(URLTemplate itemUrl) { URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID()); URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse respo...
[ "protected", "void", "removeWatermark", "(", "URLTemplate", "itemUrl", ")", "{", "URL", "watermarkUrl", "=", "itemUrl", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", ";", "URL...
Removes a watermark from the item. If the item did not have a watermark applied to it, a 404 Not Found will be returned by API. @param itemUrl url template for the item.
[ "Removes", "a", "watermark", "from", "the", "item", ".", "If", "the", "item", "did", "not", "have", "a", "watermark", "applied", "to", "it", "a", "404", "Not", "Found", "will", "be", "returned", "by", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L122-L128
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersion.java
BoxFileVersion.parseJSON
private void parseJSON(JsonObject jsonObject) { for (JsonObject.Member member : jsonObject) { JsonValue value = member.getValue(); if (value.isNull()) { continue; } try { String memberName = member.getName(); if (me...
java
private void parseJSON(JsonObject jsonObject) { for (JsonObject.Member member : jsonObject) { JsonValue value = member.getValue(); if (value.isNull()) { continue; } try { String memberName = member.getName(); if (me...
[ "private", "void", "parseJSON", "(", "JsonObject", "jsonObject", ")", "{", "for", "(", "JsonObject", ".", "Member", "member", ":", "jsonObject", ")", "{", "JsonValue", "value", "=", "member", ".", "getValue", "(", ")", ";", "if", "(", "value", ".", "isNu...
Method used to update fields with values received from API. @param jsonObject JSON-encoded info about File Version object.
[ "Method", "used", "to", "update", "fields", "with", "values", "received", "from", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L60-L93
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersion.java
BoxFileVersion.download
public void download(OutputStream output, ProgressListener listener) { URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxAPIResponse response = request.send(); InputStream ...
java
public void download(OutputStream output, ProgressListener listener) { URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxAPIResponse response = request.send(); InputStream ...
[ "public", "void", "download", "(", "OutputStream", "output", ",", "ProgressListener", "listener", ")", "{", "URL", "url", "=", "CONTENT_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "fileI...
Downloads this version of the file to a given OutputStream while reporting the progress to a ProgressListener. @param output the stream to where the file will be written. @param listener a listener for monitoring the download's progress.
[ "Downloads", "this", "version", "of", "the", "file", "to", "a", "given", "OutputStream", "while", "reporting", "the", "progress", "to", "a", "ProgressListener", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L197-L218
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersion.java
BoxFileVersion.promote
public void promote() { URL url = VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, "current"); JsonObject jsonObject = new JsonObject(); jsonObject.add("type", "file_version"); jsonObject.add("id", this.getID()); BoxJSONRequest request = new BoxJSONRequest(th...
java
public void promote() { URL url = VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, "current"); JsonObject jsonObject = new JsonObject(); jsonObject.add("type", "file_version"); jsonObject.add("id", this.getID()); BoxJSONRequest request = new BoxJSONRequest(th...
[ "public", "void", "promote", "(", ")", "{", "URL", "url", "=", "VERSION_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "fileID", ",", "\"current\"", ")", ";", "JsonObject", "jsonObject", ...
Promotes this version of the file to be the latest version.
[ "Promotes", "this", "version", "of", "the", "file", "to", "be", "the", "latest", "version", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L223-L234
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.createAppUser
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) { return createAppUser(api, name, new CreateUserParams()); }
java
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) { return createAppUser(api, name, new CreateUserParams()); }
[ "public", "static", "BoxUser", ".", "Info", "createAppUser", "(", "BoxAPIConnection", "api", ",", "String", "name", ")", "{", "return", "createAppUser", "(", "api", ",", "name", ",", "new", "CreateUserParams", "(", ")", ")", ";", "}" ]
Provisions a new app user in an enterprise using Box Developer Edition. @param api the API connection to be used by the created user. @param name the name of the user. @return the created user's info.
[ "Provisions", "a", "new", "app", "user", "in", "an", "enterprise", "using", "Box", "Developer", "Edition", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L83-L85
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.createAppUser
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name, CreateUserParams params) { params.setIsPlatformAccessOnly(true); return createEnterpriseUser(api, null, name, params); }
java
public static BoxUser.Info createAppUser(BoxAPIConnection api, String name, CreateUserParams params) { params.setIsPlatformAccessOnly(true); return createEnterpriseUser(api, null, name, params); }
[ "public", "static", "BoxUser", ".", "Info", "createAppUser", "(", "BoxAPIConnection", "api", ",", "String", "name", ",", "CreateUserParams", "params", ")", "{", "params", ".", "setIsPlatformAccessOnly", "(", "true", ")", ";", "return", "createEnterpriseUser", "(",...
Provisions a new app user in an enterprise with additional user information using Box Developer Edition. @param api the API connection to be used by the created user. @param name the name of the user. @param params additional user information. @return the created user's info.
[ "Provisions", "a", "new", "app", "user", "in", "an", "enterprise", "with", "additional", "user", "information", "using", "Box", "Developer", "Edition", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L94-L99
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.createEnterpriseUser
public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name) { return createEnterpriseUser(api, login, name, null); }
java
public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name) { return createEnterpriseUser(api, login, name, null); }
[ "public", "static", "BoxUser", ".", "Info", "createEnterpriseUser", "(", "BoxAPIConnection", "api", ",", "String", "login", ",", "String", "name", ")", "{", "return", "createEnterpriseUser", "(", "api", ",", "login", ",", "name", ",", "null", ")", ";", "}" ]
Provisions a new user in an enterprise. @param api the API connection to be used by the created user. @param login the email address the user will use to login. @param name the name of the user. @return the created user's info.
[ "Provisions", "a", "new", "user", "in", "an", "enterprise", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L108-L110
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.createEnterpriseUser
public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name, CreateUserParams params) { JsonObject requestJSON = new JsonObject(); requestJSON.add("login", login); requestJSON.add("name", name); if (params != null) { if (params.ge...
java
public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name, CreateUserParams params) { JsonObject requestJSON = new JsonObject(); requestJSON.add("login", login); requestJSON.add("name", name); if (params != null) { if (params.ge...
[ "public", "static", "BoxUser", ".", "Info", "createEnterpriseUser", "(", "BoxAPIConnection", "api", ",", "String", "login", ",", "String", "name", ",", "CreateUserParams", "params", ")", "{", "JsonObject", "requestJSON", "=", "new", "JsonObject", "(", ")", ";", ...
Provisions a new user in an enterprise with additional user information. @param api the API connection to be used by the created user. @param login the email address the user will use to login. @param name the name of the user. @param params additional user information. @return the created user's info.
[ "Provisions", "a", "new", "user", "in", "an", "enterprise", "with", "additional", "user", "information", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L120-L158
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getCurrentUser
public static BoxUser getCurrentUser(BoxAPIConnection api) { URL url = GET_ME_URL.build(api.getBaseURL()); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFrom(response.getJSON...
java
public static BoxUser getCurrentUser(BoxAPIConnection api) { URL url = GET_ME_URL.build(api.getBaseURL()); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFrom(response.getJSON...
[ "public", "static", "BoxUser", "getCurrentUser", "(", "BoxAPIConnection", "api", ")", "{", "URL", "url", "=", "GET_ME_URL", ".", "build", "(", "api", ".", "getBaseURL", "(", ")", ")", ";", "BoxAPIRequest", "request", "=", "new", "BoxAPIRequest", "(", "api", ...
Gets the current user. @param api the API connection of the current user. @return the current user.
[ "Gets", "the", "current", "user", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L165-L171
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getAllEnterpriseUsers
public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm, final String... fields) { return getUsersInfoForType(api, filterTerm, null, null, fields); }
java
public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm, final String... fields) { return getUsersInfoForType(api, filterTerm, null, null, fields); }
[ "public", "static", "Iterable", "<", "BoxUser", ".", "Info", ">", "getAllEnterpriseUsers", "(", "final", "BoxAPIConnection", "api", ",", "final", "String", "filterTerm", ",", "final", "String", "...", "fields", ")", "{", "return", "getUsersInfoForType", "(", "ap...
Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields to retrieve from the API. @param api the API connection to be used when retrieving the users. @param filterTerm used to filter the results to only users starting with this string in either the name ...
[ "Returns", "an", "iterable", "containing", "all", "the", "enterprise", "users", "that", "matches", "the", "filter", "and", "specifies", "which", "child", "fields", "to", "retrieve", "from", "the", "API", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L191-L194
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getAppUsersByExternalAppUserID
public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api, final String externalAppUserId, final String... fields) { return getUsersInfoForType(api, null, null, externalAppUserId, fields); }
java
public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api, final String externalAppUserId, final String... fields) { return getUsersInfoForType(api, null, null, externalAppUserId, fields); }
[ "public", "static", "Iterable", "<", "BoxUser", ".", "Info", ">", "getAppUsersByExternalAppUserID", "(", "final", "BoxAPIConnection", "api", ",", "final", "String", "externalAppUserId", ",", "final", "String", "...", "fields", ")", "{", "return", "getUsersInfoForTyp...
Gets any app users that has an exact match with the externalAppUserId term. @param api the API connection to be used when retrieving the users. @param externalAppUserId the external app user id that has been set for app user @param fields the fields to retrieve. Leave this out for the s...
[ "Gets", "any", "app", "users", "that", "has", "an", "exact", "match", "with", "the", "externalAppUserId", "term", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L235-L238
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getUsersInfoForType
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api, final String filterTerm, final String userType, final String externalAppUserId, final String... fields) { return new Iterable<BoxUser.Info>() { public Iterator<BoxUser.Info> iterator() { Q...
java
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api, final String filterTerm, final String userType, final String externalAppUserId, final String... fields) { return new Iterable<BoxUser.Info>() { public Iterator<BoxUser.Info> iterator() { Q...
[ "private", "static", "Iterable", "<", "BoxUser", ".", "Info", ">", "getUsersInfoForType", "(", "final", "BoxAPIConnection", "api", ",", "final", "String", "filterTerm", ",", "final", "String", "userType", ",", "final", "String", "externalAppUserId", ",", "final", ...
Helper method to abstract out the common logic from the various users methods. @param api the API connection to be used when retrieving the users. @param filterTerm The filter term to lookup users by (login for external, login or name for managed) @param userType The type of users we want...
[ "Helper", "method", "to", "abstract", "out", "the", "common", "logic", "from", "the", "various", "users", "methods", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L251-L272
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getInfo
public BoxUser.Info getInfo(String... fields) { URL url; if (fields.length > 0) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); } else ...
java
public BoxUser.Info getInfo(String... fields) { URL url; if (fields.length > 0) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); } else ...
[ "public", "BoxUser", ".", "Info", "getInfo", "(", "String", "...", "fields", ")", "{", "URL", "url", ";", "if", "(", "fields", ".", "length", ">", "0", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "...
Gets information about this user. @param fields the optional fields to retrieve. @return info about this user.
[ "Gets", "information", "about", "this", "user", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L279-L291
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getMemberships
public Collection<BoxGroupMembership.Info> getMemberships() { BoxAPIConnection api = this.getAPI(); URL url = USER_MEMBERSHIPS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONRes...
java
public Collection<BoxGroupMembership.Info> getMemberships() { BoxAPIConnection api = this.getAPI(); URL url = USER_MEMBERSHIPS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(api, url, "GET"); BoxJSONResponse response = (BoxJSONRes...
[ "public", "Collection", "<", "BoxGroupMembership", ".", "Info", ">", "getMemberships", "(", ")", "{", "BoxAPIConnection", "api", "=", "this", ".", "getAPI", "(", ")", ";", "URL", "url", "=", "USER_MEMBERSHIPS_URL_TEMPLATE", ".", "build", "(", "this", ".", "g...
Gets information about all of the group memberships for this user. Does not support paging. <p>Note: This method is only available to enterprise admins.</p> @return a collection of information about the group memberships for this user.
[ "Gets", "information", "about", "all", "of", "the", "group", "memberships", "for", "this", "user", ".", "Does", "not", "support", "paging", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L301-L320
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getAllMemberships
public Iterable<BoxGroupMembership.Info> getAllMemberships(String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxGroupMembership.Info>() { public I...
java
public Iterable<BoxGroupMembership.Info> getAllMemberships(String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxGroupMembership.Info>() { public I...
[ "public", "Iterable", "<", "BoxGroupMembership", ".", "Info", ">", "getAllMemberships", "(", "String", "...", "fields", ")", "{", "final", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", "(", "fields", ".", "length", ">"...
Gets information about all of the group memberships for this user as iterable with paging support. @param fields the fields to retrieve. @return an iterable with information about the group memberships for this user.
[ "Gets", "information", "about", "all", "of", "the", "group", "memberships", "for", "this", "user", "as", "iterable", "with", "paging", "support", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L327-L339
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.addEmailAlias
public EmailAlias addEmailAlias(String email, boolean isConfirmed) { URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); JsonObject requestJSON = new JsonObject() .add("ema...
java
public EmailAlias addEmailAlias(String email, boolean isConfirmed) { URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); JsonObject requestJSON = new JsonObject() .add("ema...
[ "public", "EmailAlias", "addEmailAlias", "(", "String", "email", ",", "boolean", "isConfirmed", ")", "{", "URL", "url", "=", "EMAIL_ALIASES_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "g...
Adds a new email alias to this user's account and confirms it without user interaction. This functionality is only available for enterprise admins. @param email the email address to add as an alias. @param isConfirmed whether or not the email alias should be automatically confirmed. @return the newly created email alia...
[ "Adds", "a", "new", "email", "alias", "to", "this", "user", "s", "account", "and", "confirms", "it", "without", "user", "interaction", ".", "This", "functionality", "is", "only", "available", "for", "enterprise", "admins", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L357-L372
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.deleteEmailAlias
public void deleteEmailAlias(String emailAliasID) { URL url = EMAIL_ALIAS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), emailAliasID); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); ...
java
public void deleteEmailAlias(String emailAliasID) { URL url = EMAIL_ALIAS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), emailAliasID); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); ...
[ "public", "void", "deleteEmailAlias", "(", "String", "emailAliasID", ")", "{", "URL", "url", "=", "EMAIL_ALIAS_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ",", "emai...
Deletes an email alias from this user's account. <p>The IDs of the user's email aliases can be found by calling {@link #getEmailAliases}.</p> @param emailAliasID the ID of the email alias to delete.
[ "Deletes", "an", "email", "alias", "from", "this", "user", "s", "account", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L381-L386
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getEmailAliases
public Collection<EmailAlias> getEmailAliases() { URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject responseJS...
java
public Collection<EmailAlias> getEmailAliases() { URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject responseJS...
[ "public", "Collection", "<", "EmailAlias", ">", "getEmailAliases", "(", ")", "{", "URL", "url", "=", "EMAIL_ALIASES_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", ...
Gets a collection of all the email aliases for this user. <p>Note that the user's primary login email is not included in the collection of email aliases.</p> @return a collection of all the email aliases for this user.
[ "Gets", "a", "collection", "of", "all", "the", "email", "aliases", "for", "this", "user", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L395-L410
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.delete
public void delete(boolean notifyUser, boolean force) { String queryString = new QueryStringBuilder() .appendParam("notify", String.valueOf(notifyUser)) .appendParam("force", String.valueOf(force)) .toString(); URL url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI()...
java
public void delete(boolean notifyUser, boolean force) { String queryString = new QueryStringBuilder() .appendParam("notify", String.valueOf(notifyUser)) .appendParam("force", String.valueOf(force)) .toString(); URL url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI()...
[ "public", "void", "delete", "(", "boolean", "notifyUser", ",", "boolean", "force", ")", "{", "String", "queryString", "=", "new", "QueryStringBuilder", "(", ")", ".", "appendParam", "(", "\"notify\"", ",", "String", ".", "valueOf", "(", "notifyUser", ")", ")...
Deletes a user from an enterprise account. @param notifyUser whether or not to send an email notification to the user that their account has been deleted. @param force whether or not this user should be deleted even if they still own files.
[ "Deletes", "a", "user", "from", "an", "enterprise", "account", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L417-L427
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getAvatar
public InputStream getAvatar() { URL url = USER_AVATAR_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxAPIResponse response = request.send(); return response.getBody(); }
java
public InputStream getAvatar() { URL url = USER_AVATAR_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxAPIResponse response = request.send(); return response.getBody(); }
[ "public", "InputStream", "getAvatar", "(", ")", "{", "URL", "url", "=", "USER_AVATAR_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", ";", "BoxAPIRequest", "request", ...
Retrieves the avatar of a user as an InputStream. @return InputStream representing the user avater.
[ "Retrieves", "the", "avatar", "of", "a", "user", "as", "an", "InputStream", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L508-L514
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxInvite.java
BoxInvite.inviteUserToEnterprise
public static Info inviteUserToEnterprise(BoxAPIConnection api, String userLogin, String enterpriseID) { URL url = INVITE_CREATION_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, "POST"); JsonObject body = new JsonObject(); JsonObject enterp...
java
public static Info inviteUserToEnterprise(BoxAPIConnection api, String userLogin, String enterpriseID) { URL url = INVITE_CREATION_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, "POST"); JsonObject body = new JsonObject(); JsonObject enterp...
[ "public", "static", "Info", "inviteUserToEnterprise", "(", "BoxAPIConnection", "api", ",", "String", "userLogin", ",", "String", "enterpriseID", ")", "{", "URL", "url", "=", "INVITE_CREATION_URL_TEMPLATE", ".", "build", "(", "api", ".", "getBaseURL", "(", ")", "...
Invite a user to an enterprise. @param api the API connection to use for the request. @param userLogin the login of the user to invite. @param enterpriseID the ID of the enterprise to invite the user to. @return the invite info.
[ "Invite", "a", "user", "to", "an", "enterprise", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxInvite.java#L61-L82
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxWebHook.java
BoxWebHook.toJsonArray
private static JsonArray toJsonArray(Collection<String> values) { JsonArray array = new JsonArray(); for (String value : values) { array.add(value); } return array; }
java
private static JsonArray toJsonArray(Collection<String> values) { JsonArray array = new JsonArray(); for (String value : values) { array.add(value); } return array; }
[ "private", "static", "JsonArray", "toJsonArray", "(", "Collection", "<", "String", ">", "values", ")", "{", "JsonArray", "array", "=", "new", "JsonArray", "(", ")", ";", "for", "(", "String", "value", ":", "values", ")", "{", "array", ".", "add", "(", ...
Helper function to create JsonArray from collection. @param values collection of values to convert to JsonArray @return JsonArray with collection values
[ "Helper", "function", "to", "create", "JsonArray", "from", "collection", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHook.java#L170-L177
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxJSONRequest.java
BoxJSONRequest.setBody
@Override public void setBody(String body) { super.setBody(body); this.jsonValue = JsonValue.readFrom(body); }
java
@Override public void setBody(String body) { super.setBody(body); this.jsonValue = JsonValue.readFrom(body); }
[ "@", "Override", "public", "void", "setBody", "(", "String", "body", ")", "{", "super", ".", "setBody", "(", "body", ")", ";", "this", ".", "jsonValue", "=", "JsonValue", ".", "readFrom", "(", "body", ")", ";", "}" ]
Sets the body of this request to a given JSON string. @param body the JSON string to use as the body.
[ "Sets", "the", "body", "of", "this", "request", "to", "a", "given", "JSON", "string", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONRequest.java#L54-L58
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxComment.java
BoxComment.changeMessage
public Info changeMessage(String newMessage) { Info newInfo = new Info(); newInfo.setMessage(newMessage); URL url = COMMENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(newIn...
java
public Info changeMessage(String newMessage) { Info newInfo = new Info(); newInfo.setMessage(newMessage); URL url = COMMENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(newIn...
[ "public", "Info", "changeMessage", "(", "String", "newMessage", ")", "{", "Info", "newInfo", "=", "new", "Info", "(", ")", ";", "newInfo", ".", "setMessage", "(", "newMessage", ")", ";", "URL", "url", "=", "COMMENT_URL_TEMPLATE", ".", "build", "(", "this",...
Changes the message of this comment. @param newMessage the new message for this comment. @return updated info about this comment.
[ "Changes", "the", "message", "of", "this", "comment", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxComment.java#L69-L80
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxComment.java
BoxComment.reply
public BoxComment.Info reply(String message) { JsonObject itemJSON = new JsonObject(); itemJSON.add("type", "comment"); itemJSON.add("id", this.getID()); JsonObject requestJSON = new JsonObject(); requestJSON.add("item", itemJSON); if (BoxComment.messageContainsMention(m...
java
public BoxComment.Info reply(String message) { JsonObject itemJSON = new JsonObject(); itemJSON.add("type", "comment"); itemJSON.add("id", this.getID()); JsonObject requestJSON = new JsonObject(); requestJSON.add("item", itemJSON); if (BoxComment.messageContainsMention(m...
[ "public", "BoxComment", ".", "Info", "reply", "(", "String", "message", ")", "{", "JsonObject", "itemJSON", "=", "new", "JsonObject", "(", ")", ";", "itemJSON", ".", "add", "(", "\"type\"", ",", "\"comment\"", ")", ";", "itemJSON", ".", "add", "(", "\"id...
Replies to this comment with another message. @param message the message for the reply. @return info about the newly created reply comment.
[ "Replies", "to", "this", "comment", "with", "another", "message", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxComment.java#L87-L108
train
box/box-java-sdk
src/main/java/com/box/sdk/InMemoryLRUAccessTokenCache.java
InMemoryLRUAccessTokenCache.put
public void put(String key, String value) { synchronized (this.cache) { this.cache.put(key, value); } }
java
public void put(String key, String value) { synchronized (this.cache) { this.cache.put(key, value); } }
[ "public", "void", "put", "(", "String", "key", ",", "String", "value", ")", "{", "synchronized", "(", "this", ".", "cache", ")", "{", "this", ".", "cache", ".", "put", "(", "key", ",", "value", ")", ";", "}", "}" ]
Add an entry to the cache. @param key key to use. @param value access token information to store.
[ "Add", "an", "entry", "to", "the", "cache", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/InMemoryLRUAccessTokenCache.java#L33-L37
train
box/box-java-sdk
src/main/java/com/box/sdk/URLTemplate.java
URLTemplate.buildWithQuery
public URL buildWithQuery(String base, String queryString, Object... values) { String urlString = String.format(base + this.template, values) + queryString; URL url = null; try { url = new URL(urlString); } catch (MalformedURLException e) { assert false : "An inva...
java
public URL buildWithQuery(String base, String queryString, Object... values) { String urlString = String.format(base + this.template, values) + queryString; URL url = null; try { url = new URL(urlString); } catch (MalformedURLException e) { assert false : "An inva...
[ "public", "URL", "buildWithQuery", "(", "String", "base", ",", "String", "queryString", ",", "Object", "...", "values", ")", "{", "String", "urlString", "=", "String", ".", "format", "(", "base", "+", "this", ".", "template", ",", "values", ")", "+", "qu...
Build a URL with Query String and URL Parameters. @param base base URL @param queryString query string @param values URL Parameters @return URL
[ "Build", "a", "URL", "with", "Query", "String", "and", "URL", "Parameters", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/URLTemplate.java#L46-L56
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.uploadPart
public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize, long totalSizeOfFile) { URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint(); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), ...
java
public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize, long totalSizeOfFile) { URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint(); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), ...
[ "public", "BoxFileUploadSessionPart", "uploadPart", "(", "InputStream", "stream", ",", "long", "offset", ",", "int", "partSize", ",", "long", "totalSizeOfFile", ")", "{", "URL", "uploadPartURL", "=", "this", ".", "sessionInfo", ".", "getSessionEndpoints", "(", ")"...
Uploads chunk of a stream to an open upload session. @param stream the stream that is used to read the chunck using the offset and part size. @param offset the byte position where the chunk begins in the file. @param partSize the part size returned as part of the upload session instance creation. Only the last chunk ca...
[ "Uploads", "chunk", "of", "a", "stream", "to", "an", "open", "upload", "session", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L241-L258
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.uploadPart
public BoxFileUploadSessionPart uploadPart(byte[] data, long offset, int partSize, long totalSizeOfFile) { URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint(); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), uploadPa...
java
public BoxFileUploadSessionPart uploadPart(byte[] data, long offset, int partSize, long totalSizeOfFile) { URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint(); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), uploadPa...
[ "public", "BoxFileUploadSessionPart", "uploadPart", "(", "byte", "[", "]", "data", ",", "long", "offset", ",", "int", "partSize", ",", "long", "totalSizeOfFile", ")", "{", "URL", "uploadPartURL", "=", "this", ".", "sessionInfo", ".", "getSessionEndpoints", "(", ...
Uploads bytes to an open upload session. @param data data @param offset the byte position where the chunk begins in the file. @param partSize the part size returned as part of the upload session instance creation. Only the last chunk can have a lesser value. @param totalSizeOfFile The total size of the file being uploa...
[ "Uploads", "bytes", "to", "an", "open", "upload", "session", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L269-L297
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.listParts
public BoxFileUploadSessionPartList listParts(int offset, int limit) { URL listPartsURL = this.sessionInfo.getSessionEndpoints().getListPartsEndpoint(); URLTemplate template = new URLTemplate(listPartsURL.toString()); QueryStringBuilder builder = new QueryStringBuilder(); builder.append...
java
public BoxFileUploadSessionPartList listParts(int offset, int limit) { URL listPartsURL = this.sessionInfo.getSessionEndpoints().getListPartsEndpoint(); URLTemplate template = new URLTemplate(listPartsURL.toString()); QueryStringBuilder builder = new QueryStringBuilder(); builder.append...
[ "public", "BoxFileUploadSessionPartList", "listParts", "(", "int", "offset", ",", "int", "limit", ")", "{", "URL", "listPartsURL", "=", "this", ".", "sessionInfo", ".", "getSessionEndpoints", "(", ")", ".", "getListPartsEndpoint", "(", ")", ";", "URLTemplate", "...
Returns a list of all parts that have been uploaded to an upload session. @param offset paging marker for the list of parts. @param limit maximum number of parts to return. @return the list of parts.
[ "Returns", "a", "list", "of", "all", "parts", "that", "have", "been", "uploaded", "to", "an", "upload", "session", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L305-L321
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.commit
public BoxFile.Info commit(String digest, List<BoxFileUploadSessionPart> parts, Map<String, String> attributes, String ifMatch, String ifNoneMatch) { URL commitURL = this.sessionInfo.getSessionEndpoints().getCommitEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI...
java
public BoxFile.Info commit(String digest, List<BoxFileUploadSessionPart> parts, Map<String, String> attributes, String ifMatch, String ifNoneMatch) { URL commitURL = this.sessionInfo.getSessionEndpoints().getCommitEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI...
[ "public", "BoxFile", ".", "Info", "commit", "(", "String", "digest", ",", "List", "<", "BoxFileUploadSessionPart", ">", "parts", ",", "Map", "<", "String", ",", "String", ">", "attributes", ",", "String", "ifMatch", ",", "String", "ifNoneMatch", ")", "{", ...
Commit an upload session after all parts have been uploaded, creating the new file or the version. @param digest the base64-encoded SHA-1 hash of the file being uploaded. @param parts the list of uploaded parts to be committed. @param attributes the key value pairs of attributes from the file instance. @param ifMatch e...
[ "Commit", "an", "upload", "session", "after", "all", "parts", "have", "been", "uploaded", "creating", "the", "new", "file", "or", "the", "version", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L332-L374
train