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-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getCollaborationsRequest
public BoxRequestsFile.GetCollaborations getCollaborationsRequest(String id) { BoxRequestsFile.GetCollaborations request = new BoxRequestsFile.GetCollaborations(id, getFileCollaborationsUrl(id), mSession); return request; }
java
public BoxRequestsFile.GetCollaborations getCollaborationsRequest(String id) { BoxRequestsFile.GetCollaborations request = new BoxRequestsFile.GetCollaborations(id, getFileCollaborationsUrl(id), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "GetCollaborations", "getCollaborationsRequest", "(", "String", "id", ")", "{", "BoxRequestsFile", ".", "GetCollaborations", "request", "=", "new", "BoxRequestsFile", ".", "GetCollaborations", "(", "id", ",", "getFileCollaborationsUrl", ...
Gets a request that gets the collaborations of a file @param id id of file to request collaborations of @return request to get collaborations
[ "Gets", "a", "request", "that", "gets", "the", "collaborations", "of", "a", "file" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L496-L499
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getVersionsRequest
public BoxRequestsFile.GetFileVersions getVersionsRequest(String id) { BoxRequestsFile.GetFileVersions request = new BoxRequestsFile.GetFileVersions(id, getFileVersionsUrl(id), mSession); return request; }
java
public BoxRequestsFile.GetFileVersions getVersionsRequest(String id) { BoxRequestsFile.GetFileVersions request = new BoxRequestsFile.GetFileVersions(id, getFileVersionsUrl(id), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "GetFileVersions", "getVersionsRequest", "(", "String", "id", ")", "{", "BoxRequestsFile", ".", "GetFileVersions", "request", "=", "new", "BoxRequestsFile", ".", "GetFileVersions", "(", "id", ",", "getFileVersionsUrl", "(", "id", ")...
Gets a request that retrieves the versions of a file @param id id of the file to retrieve file versions for @return request to retrieve versions of a file
[ "Gets", "a", "request", "that", "retrieves", "the", "versions", "of", "a", "file" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L507-L510
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getDeleteVersionRequest
public BoxRequestsFile.DeleteFileVersion getDeleteVersionRequest(String id, String versionId) { BoxRequestsFile.DeleteFileVersion request = new BoxRequestsFile.DeleteFileVersion(versionId, getDeleteFileVersionUrl(id, versionId), mSession); return request; }
java
public BoxRequestsFile.DeleteFileVersion getDeleteVersionRequest(String id, String versionId) { BoxRequestsFile.DeleteFileVersion request = new BoxRequestsFile.DeleteFileVersion(versionId, getDeleteFileVersionUrl(id, versionId), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "DeleteFileVersion", "getDeleteVersionRequest", "(", "String", "id", ",", "String", "versionId", ")", "{", "BoxRequestsFile", ".", "DeleteFileVersion", "request", "=", "new", "BoxRequestsFile", ".", "DeleteFileVersion", "(", "versionId"...
Gets a request that deletes a version of a file @param id id of the file to delete a version of @param versionId id of the file version to delete @return request to delete a file version
[ "Gets", "a", "request", "that", "deletes", "a", "version", "of", "a", "file" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L533-L536
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getAddToCollectionRequest
public BoxRequestsFile.AddFileToCollection getAddToCollectionRequest(String fileId, String collectionId) { BoxRequestsFile.AddFileToCollection request = new BoxRequestsFile.AddFileToCollection(fileId, collectionId, getFileInfoUrl(fileId), mSession); return request; }
java
public BoxRequestsFile.AddFileToCollection getAddToCollectionRequest(String fileId, String collectionId) { BoxRequestsFile.AddFileToCollection request = new BoxRequestsFile.AddFileToCollection(fileId, collectionId, getFileInfoUrl(fileId), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "AddFileToCollection", "getAddToCollectionRequest", "(", "String", "fileId", ",", "String", "collectionId", ")", "{", "BoxRequestsFile", ".", "AddFileToCollection", "request", "=", "new", "BoxRequestsFile", ".", "AddFileToCollection", "("...
Gets a request that adds a file to a collection @param fileId id of file to add to collection @param collectionId id of collection to add the file to @return request to add a file to a collection
[ "Gets", "a", "request", "that", "adds", "a", "file", "to", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L545-L548
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getDeleteFromCollectionRequest
public BoxRequestsFile.DeleteFileFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsFile.DeleteFileFromCollection request = new BoxRequestsFile.DeleteFileFromCollection(id, getFileInfoUrl(id), mSession); return request; }
java
public BoxRequestsFile.DeleteFileFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsFile.DeleteFileFromCollection request = new BoxRequestsFile.DeleteFileFromCollection(id, getFileInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "DeleteFileFromCollection", "getDeleteFromCollectionRequest", "(", "String", "id", ")", "{", "BoxRequestsFile", ".", "DeleteFileFromCollection", "request", "=", "new", "BoxRequestsFile", ".", "DeleteFileFromCollection", "(", "id", ",", "g...
Gets a request that removes a file from a collection @param id id of file to delete from the collection @return request to delete a file from a collection
[ "Gets", "a", "request", "that", "removes", "a", "file", "from", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L556-L559
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getFilePreviewedRequest
public BoxRequestsFile.FilePreviewed getFilePreviewedRequest(String fileId) { return new BoxRequestsFile.FilePreviewed(fileId, getPreviewFileUrl(), mSession); }
java
public BoxRequestsFile.FilePreviewed getFilePreviewedRequest(String fileId) { return new BoxRequestsFile.FilePreviewed(fileId, getPreviewFileUrl(), mSession); }
[ "public", "BoxRequestsFile", ".", "FilePreviewed", "getFilePreviewedRequest", "(", "String", "fileId", ")", "{", "return", "new", "BoxRequestsFile", ".", "FilePreviewed", "(", "fileId", ",", "getPreviewFileUrl", "(", ")", ",", "mSession", ")", ";", "}" ]
Gets a request that inform the server that a file was previewed. This makes the file to be included on the recents list. @param fileId @return request to inform the server that a file was previewed
[ "Gets", "a", "request", "that", "inform", "the", "server", "that", "a", "file", "was", "previewed", ".", "This", "makes", "the", "file", "to", "be", "included", "on", "the", "recents", "list", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L568-L570
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getUploadSession
public BoxRequestsFile.GetUploadSession getUploadSession(String uploadSessionId) { return new BoxRequestsFile.GetUploadSession(uploadSessionId, getUploadSessionInfoUrl(uploadSessionId), mSession); }
java
public BoxRequestsFile.GetUploadSession getUploadSession(String uploadSessionId) { return new BoxRequestsFile.GetUploadSession(uploadSessionId, getUploadSessionInfoUrl(uploadSessionId), mSession); }
[ "public", "BoxRequestsFile", ".", "GetUploadSession", "getUploadSession", "(", "String", "uploadSessionId", ")", "{", "return", "new", "BoxRequestsFile", ".", "GetUploadSession", "(", "uploadSessionId", ",", "getUploadSessionInfoUrl", "(", "uploadSessionId", ")", ",", "...
Gets a request to fetch the upload session using the upload session id. It contains the number of parts that are processed so far, the total number of parts required for the commit and expiration date and time of the upload session. @return the status.
[ "Gets", "a", "request", "to", "fetch", "the", "upload", "session", "using", "the", "upload", "session", "id", ".", "It", "contains", "the", "number", "of", "parts", "that", "are", "processed", "so", "far", "the", "total", "number", "of", "parts", "required...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L688-L690
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java
BoxRequestEvent.setLimit
public R setLimit(final int limit){ mQueryMap.put(FIELD_LIMIT, Integer.toString(limit)); return (R)this; }
java
public R setLimit(final int limit){ mQueryMap.put(FIELD_LIMIT, Integer.toString(limit)); return (R)this; }
[ "public", "R", "setLimit", "(", "final", "int", "limit", ")", "{", "mQueryMap", ".", "put", "(", "FIELD_LIMIT", ",", "Integer", ".", "toString", "(", "limit", ")", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the maximum number of events to return in the list of events. @param limit max number of events to request. @return the get events request
[ "Sets", "the", "maximum", "number", "of", "events", "to", "return", "in", "the", "list", "of", "events", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java#L102-L105
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java
BoxRequestEvent.setPreviousListEvents
public R setPreviousListEvents(E listEvents){ mListEvents = listEvents; this.setStreamPosition(((IStreamPosition)mListEvents).getNextStreamPosition().toString()); return (R)this; }
java
public R setPreviousListEvents(E listEvents){ mListEvents = listEvents; this.setStreamPosition(((IStreamPosition)mListEvents).getNextStreamPosition().toString()); return (R)this; }
[ "public", "R", "setPreviousListEvents", "(", "E", "listEvents", ")", "{", "mListEvents", "=", "listEvents", ";", "this", ".", "setStreamPosition", "(", "(", "(", "IStreamPosition", ")", "mListEvents", ")", ".", "getNextStreamPosition", "(", ")", ".", "toString",...
Convenience method. When set the request will be set to the next stream position from the given event and will will aggregate the new results with the provided list. @param listEvents A list of events to add to. @return A BoxRequestEvent object.
[ "Convenience", "method", ".", "When", "set", "the", "request", "will", "be", "set", "to", "the", "next", "stream", "position", "from", "the", "given", "event", "and", "will", "will", "aggregate", "the", "new", "results", "with", "the", "provided", "list", ...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java#L112-L116
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java
BoxRequestEvent.writeObject
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { // Write out capacity and any hidden stuff s.defaultWriteObject(); }
java
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { // Write out capacity and any hidden stuff s.defaultWriteObject(); }
[ "private", "void", "writeObject", "(", "java", ".", "io", ".", "ObjectOutputStream", "s", ")", "throws", "java", ".", "io", ".", "IOException", "{", "// Write out capacity and any hidden stuff", "s", ".", "defaultWriteObject", "(", ")", ";", "}" ]
Serialize object. @serialData The capacity (int), followed by elements (each an {@code Object}) in the proper order, followed by a null @param s the stream
[ "Serialize", "object", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestEvent.java#L135-L138
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFolder.java
BoxFolder.createFromIdAndName
public static BoxFolder createFromIdAndName(String folderId, String name) { JsonObject object = new JsonObject(); object.add(BoxItem.FIELD_ID, folderId); object.add(BoxItem.FIELD_TYPE, BoxFolder.TYPE); if (!TextUtils.isEmpty(name)) { object.add(BoxItem.FIELD_NAME, name); } return new BoxFolder(object); }
java
public static BoxFolder createFromIdAndName(String folderId, String name) { JsonObject object = new JsonObject(); object.add(BoxItem.FIELD_ID, folderId); object.add(BoxItem.FIELD_TYPE, BoxFolder.TYPE); if (!TextUtils.isEmpty(name)) { object.add(BoxItem.FIELD_NAME, name); } return new BoxFolder(object); }
[ "public", "static", "BoxFolder", "createFromIdAndName", "(", "String", "folderId", ",", "String", "name", ")", "{", "JsonObject", "object", "=", "new", "JsonObject", "(", ")", ";", "object", ".", "add", "(", "BoxItem", ".", "FIELD_ID", ",", "folderId", ")", ...
A convenience method to create an empty folder with just the id and type fields set. This allows the ability to interact with the content sdk in a more descriptive and type safe manner @param folderId the id of folder to create @param name the name of the folder to create @return an empty BoxFolder object that only contains id and type information
[ "A", "convenience", "method", "to", "create", "an", "empty", "folder", "with", "just", "the", "id", "and", "type", "fields", "set", ".", "This", "allows", "the", "ability", "to", "interact", "with", "the", "content", "sdk", "in", "a", "more", "descriptive"...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFolder.java#L107-L115
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxBookmark.java
BoxBookmark.createFromId
public static BoxBookmark createFromId(String bookmarkId) { JsonObject object = new JsonObject(); object.add(FIELD_ID, bookmarkId); object.add(FIELD_TYPE, TYPE); return new BoxBookmark(object); }
java
public static BoxBookmark createFromId(String bookmarkId) { JsonObject object = new JsonObject(); object.add(FIELD_ID, bookmarkId); object.add(FIELD_TYPE, TYPE); return new BoxBookmark(object); }
[ "public", "static", "BoxBookmark", "createFromId", "(", "String", "bookmarkId", ")", "{", "JsonObject", "object", "=", "new", "JsonObject", "(", ")", ";", "object", ".", "add", "(", "FIELD_ID", ",", "bookmarkId", ")", ";", "object", ".", "add", "(", "FIELD...
A convenience method to create an empty bookmark with just the id and type fields set. This allows the ability to interact with the content sdk in a more descriptive and type safe manner @param bookmarkId the id of folder to create @return an empty BoxBookmark object that only contains id and type information
[ "A", "convenience", "method", "to", "create", "an", "empty", "bookmark", "with", "just", "the", "id", "and", "type", "fields", "set", ".", "This", "allows", "the", "ability", "to", "interact", "with", "the", "content", "sdk", "in", "a", "more", "descriptiv...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxBookmark.java#L63-L68
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpRequest.java
BoxHttpRequest.addHeader
public BoxHttpRequest addHeader(String key, String value) { mUrlConnection.addRequestProperty(key, value); return this; }
java
public BoxHttpRequest addHeader(String key, String value) { mUrlConnection.addRequestProperty(key, value); return this; }
[ "public", "BoxHttpRequest", "addHeader", "(", "String", "key", ",", "String", "value", ")", "{", "mUrlConnection", ".", "addRequestProperty", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds an HTTP header to the request. @param key the header key. @param value the header value. @return request with the updated header.
[ "Adds", "an", "HTTP", "header", "to", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpRequest.java#L49-L52
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpRequest.java
BoxHttpRequest.setBody
public BoxHttpRequest setBody(InputStream body) throws IOException { mUrlConnection.setDoOutput(true); OutputStream output = mUrlConnection.getOutputStream(); int b = body.read(); while (b != -1) { output.write(b); b = body.read(); } output.close(); return this; }
java
public BoxHttpRequest setBody(InputStream body) throws IOException { mUrlConnection.setDoOutput(true); OutputStream output = mUrlConnection.getOutputStream(); int b = body.read(); while (b != -1) { output.write(b); b = body.read(); } output.close(); return this; }
[ "public", "BoxHttpRequest", "setBody", "(", "InputStream", "body", ")", "throws", "IOException", "{", "mUrlConnection", ".", "setDoOutput", "(", "true", ")", ";", "OutputStream", "output", "=", "mUrlConnection", ".", "getOutputStream", "(", ")", ";", "int", "b",...
Sets the body for the HTTP request to the contents of an InputStream. @param body InputStream to use for the contents of the body. @return request with the updated body input stream. @throws IOException
[ "Sets", "the", "body", "for", "the", "HTTP", "request", "to", "the", "contents", "of", "an", "InputStream", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpRequest.java#L61-L71
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getCurrentUserInfoRequest
public BoxRequestsUser.GetUserInfo getCurrentUserInfoRequest() { BoxRequestsUser.GetUserInfo request = new BoxRequestsUser.GetUserInfo(getUserInformationUrl("me"), mSession); return request; }
java
public BoxRequestsUser.GetUserInfo getCurrentUserInfoRequest() { BoxRequestsUser.GetUserInfo request = new BoxRequestsUser.GetUserInfo(getUserInformationUrl("me"), mSession); return request; }
[ "public", "BoxRequestsUser", ".", "GetUserInfo", "getCurrentUserInfoRequest", "(", ")", "{", "BoxRequestsUser", ".", "GetUserInfo", "request", "=", "new", "BoxRequestsUser", ".", "GetUserInfo", "(", "getUserInformationUrl", "(", "\"me\"", ")", ",", "mSession", ")", ...
Gets a request that gets information about the current user @return request to get information about the current user
[ "Gets", "a", "request", "that", "gets", "information", "about", "the", "current", "user" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L57-L60
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getUserInfoRequest
public BoxRequestsUser.GetUserInfo getUserInfoRequest(String id) { BoxRequestsUser.GetUserInfo request = new BoxRequestsUser.GetUserInfo(getUserInformationUrl(id), mSession); return request; }
java
public BoxRequestsUser.GetUserInfo getUserInfoRequest(String id) { BoxRequestsUser.GetUserInfo request = new BoxRequestsUser.GetUserInfo(getUserInformationUrl(id), mSession); return request; }
[ "public", "BoxRequestsUser", ".", "GetUserInfo", "getUserInfoRequest", "(", "String", "id", ")", "{", "BoxRequestsUser", ".", "GetUserInfo", "request", "=", "new", "BoxRequestsUser", ".", "GetUserInfo", "(", "getUserInformationUrl", "(", "id", ")", ",", "mSession", ...
Gets a request that gets information about a user @param id id of the user to get information on @return request to get information about a user
[ "Gets", "a", "request", "that", "gets", "information", "about", "a", "user" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L68-L71
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getEnterpriseUsersRequest
public BoxRequestsUser.GetEnterpriseUsers getEnterpriseUsersRequest() { BoxRequestsUser.GetEnterpriseUsers request = new BoxRequestsUser.GetEnterpriseUsers(getUsersUrl(), mSession); return request; }
java
public BoxRequestsUser.GetEnterpriseUsers getEnterpriseUsersRequest() { BoxRequestsUser.GetEnterpriseUsers request = new BoxRequestsUser.GetEnterpriseUsers(getUsersUrl(), mSession); return request; }
[ "public", "BoxRequestsUser", ".", "GetEnterpriseUsers", "getEnterpriseUsersRequest", "(", ")", "{", "BoxRequestsUser", ".", "GetEnterpriseUsers", "request", "=", "new", "BoxRequestsUser", ".", "GetEnterpriseUsers", "(", "getUsersUrl", "(", ")", ",", "mSession", ")", "...
Gets a request that gets all the users of an enterprise The session provided must be associated with an enterprise admin user @return request to get all users of an enterprise
[ "Gets", "a", "request", "that", "gets", "all", "the", "users", "of", "an", "enterprise", "The", "session", "provided", "must", "be", "associated", "with", "an", "enterprise", "admin", "user" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L79-L82
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getCreateEnterpriseUserRequest
public BoxRequestsUser.CreateEnterpriseUser getCreateEnterpriseUserRequest(String login, String name) { BoxRequestsUser.CreateEnterpriseUser request = new BoxRequestsUser.CreateEnterpriseUser(getUsersUrl(), mSession, login, name); return request; }
java
public BoxRequestsUser.CreateEnterpriseUser getCreateEnterpriseUserRequest(String login, String name) { BoxRequestsUser.CreateEnterpriseUser request = new BoxRequestsUser.CreateEnterpriseUser(getUsersUrl(), mSession, login, name); return request; }
[ "public", "BoxRequestsUser", ".", "CreateEnterpriseUser", "getCreateEnterpriseUserRequest", "(", "String", "login", ",", "String", "name", ")", "{", "BoxRequestsUser", ".", "CreateEnterpriseUser", "request", "=", "new", "BoxRequestsUser", ".", "CreateEnterpriseUser", "(",...
Gets a request that creates an enterprise user The session provided must be associated with an enterprise admin user @param login the login (email) of the user to create @param name name of the user to create @return request to create an enterprise user
[ "Gets", "a", "request", "that", "creates", "an", "enterprise", "user", "The", "session", "provided", "must", "be", "associated", "with", "an", "enterprise", "admin", "user" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L92-L95
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getDeleteEnterpriseUserRequest
public BoxRequestsUser.DeleteEnterpriseUser getDeleteEnterpriseUserRequest(String userId) { BoxRequestsUser.DeleteEnterpriseUser request = new BoxRequestsUser.DeleteEnterpriseUser(getUserInformationUrl(userId), mSession, userId); return request; }
java
public BoxRequestsUser.DeleteEnterpriseUser getDeleteEnterpriseUserRequest(String userId) { BoxRequestsUser.DeleteEnterpriseUser request = new BoxRequestsUser.DeleteEnterpriseUser(getUserInformationUrl(userId), mSession, userId); return request; }
[ "public", "BoxRequestsUser", ".", "DeleteEnterpriseUser", "getDeleteEnterpriseUserRequest", "(", "String", "userId", ")", "{", "BoxRequestsUser", ".", "DeleteEnterpriseUser", "request", "=", "new", "BoxRequestsUser", ".", "DeleteEnterpriseUser", "(", "getUserInformationUrl", ...
Gets a request that deletes an enterprise user The session provided must be associated with an enterprise admin user @param userId id of the user @return request to delete an enterprise user
[ "Gets", "a", "request", "that", "deletes", "an", "enterprise", "user", "The", "session", "provided", "must", "be", "associated", "with", "an", "enterprise", "admin", "user" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L104-L107
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getDownloadAvatarRequest
public BoxRequestsFile.DownloadAvatar getDownloadAvatarRequest(File target, String userId) throws IOException{ if (!target.exists()){ throw new FileNotFoundException(); } BoxRequestsFile.DownloadAvatar request = new BoxRequestsFile.DownloadAvatar(userId, target, getAvatarDownloadUrl(userId), mSession) .setAvatarType(BoxRequestsFile.DownloadAvatar.LARGE); return request; }
java
public BoxRequestsFile.DownloadAvatar getDownloadAvatarRequest(File target, String userId) throws IOException{ if (!target.exists()){ throw new FileNotFoundException(); } BoxRequestsFile.DownloadAvatar request = new BoxRequestsFile.DownloadAvatar(userId, target, getAvatarDownloadUrl(userId), mSession) .setAvatarType(BoxRequestsFile.DownloadAvatar.LARGE); return request; }
[ "public", "BoxRequestsFile", ".", "DownloadAvatar", "getDownloadAvatarRequest", "(", "File", "target", ",", "String", "userId", ")", "throws", "IOException", "{", "if", "(", "!", "target", ".", "exists", "(", ")", ")", "{", "throw", "new", "FileNotFoundException...
Gets a request that downloads an avatar of the target user id. @param target target file to download to, target can be either a directory or a file @param userId id of user to download avatar of @return request to download a thumbnail to a target file @throws IOException throws FileNotFoundException if target file does not exist.
[ "Gets", "a", "request", "that", "downloads", "an", "avatar", "of", "the", "target", "user", "id", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L117-L124
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java
BoxApiUser.getDownloadAvatarRequest
public BoxRequestsFile.DownloadFile getDownloadAvatarRequest(OutputStream outputStream, String userId) { BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(userId, outputStream, getAvatarDownloadUrl(userId), mSession); return request; }
java
public BoxRequestsFile.DownloadFile getDownloadAvatarRequest(OutputStream outputStream, String userId) { BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(userId, outputStream, getAvatarDownloadUrl(userId), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "DownloadFile", "getDownloadAvatarRequest", "(", "OutputStream", "outputStream", ",", "String", "userId", ")", "{", "BoxRequestsFile", ".", "DownloadFile", "request", "=", "new", "BoxRequestsFile", ".", "DownloadFile", "(", "userId", ...
Gets a request that downloads the given avatar to the provided outputStream. Developer is responsible for closing the outputStream provided. @param outputStream outputStream to write file contents to. @param userId the file id to download. @return request to download a file thumbnail
[ "Gets", "a", "request", "that", "downloads", "the", "given", "avatar", "to", "the", "provided", "outputStream", ".", "Developer", "is", "responsible", "for", "closing", "the", "outputStream", "provided", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiUser.java#L133-L136
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setName
public R setName(String name) { mBodyMap.put(BoxUser.FIELD_NAME, name); return (R) this; }
java
public R setName(String name) { mBodyMap.put(BoxUser.FIELD_NAME, name); return (R) this; }
[ "public", "R", "setName", "(", "String", "name", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_NAME", ",", "name", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the new name for the user in the request. @param name new name for the user. @return request with the updated name.
[ "Sets", "the", "new", "name", "for", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L33-L36
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setRole
public R setRole(BoxUser.Role role) { mBodyMap.put(BoxUser.FIELD_ROLE, role); return (R) this; }
java
public R setRole(BoxUser.Role role) { mBodyMap.put(BoxUser.FIELD_ROLE, role); return (R) this; }
[ "public", "R", "setRole", "(", "BoxUser", ".", "Role", "role", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_ROLE", ",", "role", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the new role for the user. @param role new role for the user. @return request with the updated role.
[ "Sets", "the", "new", "role", "for", "the", "user", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L53-L56
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setJobTitle
public R setJobTitle(String jobTitle) { mBodyMap.put(BoxUser.FIELD_JOB_TITLE, jobTitle); return (R) this; }
java
public R setJobTitle(String jobTitle) { mBodyMap.put(BoxUser.FIELD_JOB_TITLE, jobTitle); return (R) this; }
[ "public", "R", "setJobTitle", "(", "String", "jobTitle", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_JOB_TITLE", ",", "jobTitle", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the job title for the user in the request. @param jobTitle new job title for the user. @return request with the updated job title.
[ "Sets", "the", "job", "title", "for", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L93-L96
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setPhone
public R setPhone(String phone) { mBodyMap.put(BoxUser.FIELD_PHONE, phone); return (R) this; }
java
public R setPhone(String phone) { mBodyMap.put(BoxUser.FIELD_PHONE, phone); return (R) this; }
[ "public", "R", "setPhone", "(", "String", "phone", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_PHONE", ",", "phone", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the phone number of the user in the request. @param phone new phone number for the user. @return request with the updated phone number.
[ "Sets", "the", "phone", "number", "of", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L113-L116
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setAddress
public R setAddress(String address) { mBodyMap.put(BoxUser.FIELD_ADDRESS, address); return (R) this; }
java
public R setAddress(String address) { mBodyMap.put(BoxUser.FIELD_ADDRESS, address); return (R) this; }
[ "public", "R", "setAddress", "(", "String", "address", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_ADDRESS", ",", "address", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the address of the user in the request. @param address new address for the user. @return request with the updated address.
[ "Sets", "the", "address", "of", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L133-L136
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setStatus
public R setStatus(BoxUser.Status status) { mBodyMap.put(BoxUser.FIELD_STATUS, status); return (R) this; }
java
public R setStatus(BoxUser.Status status) { mBodyMap.put(BoxUser.FIELD_STATUS, status); return (R) this; }
[ "public", "R", "setStatus", "(", "BoxUser", ".", "Status", "status", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_STATUS", ",", "status", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the status for the user in the request. @param status new {@link com.box.androidsdk.content.models.BoxUser.Status} for the user. @return request with the updated status for the user.
[ "Sets", "the", "status", "for", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L193-L196
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java
BoxRequestUserUpdate.setTimezone
public R setTimezone(String timezone) { mBodyMap.put(BoxUser.FIELD_TIMEZONE, timezone); return (R) this; }
java
public R setTimezone(String timezone) { mBodyMap.put(BoxUser.FIELD_TIMEZONE, timezone); return (R) this; }
[ "public", "R", "setTimezone", "(", "String", "timezone", ")", "{", "mBodyMap", ".", "put", "(", "BoxUser", ".", "FIELD_TIMEZONE", ",", "timezone", ")", ";", "return", "(", "R", ")", "this", ";", "}" ]
Sets the timezone for the user in the request. @param timezone new timezone for the user. @return request with the updated timezone.
[ "Sets", "the", "timezone", "for", "the", "user", "in", "the", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestUserUpdate.java#L213-L216
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiRecentItems.java
BoxApiRecentItems.getRecentItemsRequest
public BoxRequestRecentItems.GetRecentItems getRecentItemsRequest() { BoxRequestRecentItems.GetRecentItems request = new BoxRequestRecentItems.GetRecentItems(getRecentItemsUrl(), mSession); return request; }
java
public BoxRequestRecentItems.GetRecentItems getRecentItemsRequest() { BoxRequestRecentItems.GetRecentItems request = new BoxRequestRecentItems.GetRecentItems(getRecentItemsUrl(), mSession); return request; }
[ "public", "BoxRequestRecentItems", ".", "GetRecentItems", "getRecentItemsRequest", "(", ")", "{", "BoxRequestRecentItems", ".", "GetRecentItems", "request", "=", "new", "BoxRequestRecentItems", ".", "GetRecentItems", "(", "getRecentItemsUrl", "(", ")", ",", "mSession", ...
Gets a request that gets users recent items @return request to get users recent items
[ "Gets", "a", "request", "that", "gets", "users", "recent", "items" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiRecentItems.java#L35-L38
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxExpiringEmbedLinkFile.java
BoxExpiringEmbedLinkFile.isEmbedLinkUrlExpired
public boolean isEmbedLinkUrlExpired(){ Long urlCreationTime = getUrlCreationTime(); if (urlCreationTime == null){ return true; } return (System.currentTimeMillis() - urlCreationTime) < (60 * 1000); }
java
public boolean isEmbedLinkUrlExpired(){ Long urlCreationTime = getUrlCreationTime(); if (urlCreationTime == null){ return true; } return (System.currentTimeMillis() - urlCreationTime) < (60 * 1000); }
[ "public", "boolean", "isEmbedLinkUrlExpired", "(", ")", "{", "Long", "urlCreationTime", "=", "getUrlCreationTime", "(", ")", ";", "if", "(", "urlCreationTime", "==", "null", ")", "{", "return", "true", ";", "}", "return", "(", "System", ".", "currentTimeMillis...
Convenience method to check if 60 seconds has passed since the time this link was created. @return false if creation time is less than 60 seconds, true otherwise.
[ "Convenience", "method", "to", "check", "if", "60", "seconds", "has", "passed", "since", "the", "time", "this", "link", "was", "created", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxExpiringEmbedLinkFile.java#L69-L75
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxExpiringEmbedLinkFile.java
BoxExpiringEmbedLinkFile.isPreviewSessionExpired
public boolean isPreviewSessionExpired(){ Long urlCreationTime = getUrlCreationTime(); if (urlCreationTime == null){ return true; } return (System.currentTimeMillis() - urlCreationTime) < (60 * 60 * 1000); }
java
public boolean isPreviewSessionExpired(){ Long urlCreationTime = getUrlCreationTime(); if (urlCreationTime == null){ return true; } return (System.currentTimeMillis() - urlCreationTime) < (60 * 60 * 1000); }
[ "public", "boolean", "isPreviewSessionExpired", "(", ")", "{", "Long", "urlCreationTime", "=", "getUrlCreationTime", "(", ")", ";", "if", "(", "urlCreationTime", "==", "null", ")", "{", "return", "true", ";", "}", "return", "(", "System", ".", "currentTimeMill...
Convenience method to check if 60 minutes has passed since the time this link was created. @return false if creation time is less than 60 minutes, true otherwise.
[ "Convenience", "method", "to", "check", "if", "60", "minutes", "has", "passed", "since", "the", "time", "this", "link", "was", "created", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxExpiringEmbedLinkFile.java#L81-L87
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getInfoRequest
public BoxRequestsBookmark.GetBookmarkInfo getInfoRequest(final String id) { BoxRequestsBookmark.GetBookmarkInfo request = new BoxRequestsBookmark.GetBookmarkInfo(id, getBookmarkInfoUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.GetBookmarkInfo getInfoRequest(final String id) { BoxRequestsBookmark.GetBookmarkInfo request = new BoxRequestsBookmark.GetBookmarkInfo(id, getBookmarkInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "GetBookmarkInfo", "getInfoRequest", "(", "final", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "GetBookmarkInfo", "request", "=", "new", "BoxRequestsBookmark", ".", "GetBookmarkInfo", "(", "id", ",", "getBookmarkInfoUrl", ...
Gets a request that retrieves information on a bookmark @param id id of bookmark to retrieve info on @return request to get a bookmarks information
[ "Gets", "a", "request", "that", "retrieves", "information", "on", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L73-L76
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getCreateRequest
public BoxRequestsBookmark.CreateBookmark getCreateRequest(String parentId, String url) { BoxRequestsBookmark.CreateBookmark request = new BoxRequestsBookmark.CreateBookmark(parentId, url, getBookmarksUrl(), mSession); return request; }
java
public BoxRequestsBookmark.CreateBookmark getCreateRequest(String parentId, String url) { BoxRequestsBookmark.CreateBookmark request = new BoxRequestsBookmark.CreateBookmark(parentId, url, getBookmarksUrl(), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "CreateBookmark", "getCreateRequest", "(", "String", "parentId", ",", "String", "url", ")", "{", "BoxRequestsBookmark", ".", "CreateBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "CreateBookmark", "(", "parentId", "...
Gets a request that creates a bookmark in a parent bookmark @param parentId id of the parent bookmark to create the bookmark in @param url URL of the new bookmark @return request to create a bookmark
[ "Gets", "a", "request", "that", "creates", "a", "bookmark", "in", "a", "parent", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L85-L88
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getUpdateRequest
public BoxRequestsBookmark.UpdateBookmark getUpdateRequest(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.UpdateBookmark getUpdateRequest(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "UpdateBookmark", "getUpdateRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "UpdateBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "UpdateBookmark", "(", "id", ",", "getBookmarkInfoUrl", "(", "id...
Gets a request that updates a bookmark's information @param id id of bookmark to update information on @return request to update a bookmark's information
[ "Gets", "a", "request", "that", "updates", "a", "bookmark", "s", "information" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L96-L99
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getCopyRequest
public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) { BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) { BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "CopyBookmark", "getCopyRequest", "(", "String", "id", ",", "String", "parentId", ")", "{", "BoxRequestsBookmark", ".", "CopyBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "CopyBookmark", "(", "id", ",", "parentId...
Gets a request that copies a bookmark @param id id of the bookmark to copy @param parentId id of the parent folder to copy the bookmark into @return request to copy a bookmark
[ "Gets", "a", "request", "that", "copies", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L108-L111
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getRenameRequest
public BoxRequestsBookmark.UpdateBookmark getRenameRequest(String id, String newName) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); request.setName(newName); return request; }
java
public BoxRequestsBookmark.UpdateBookmark getRenameRequest(String id, String newName) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); request.setName(newName); return request; }
[ "public", "BoxRequestsBookmark", ".", "UpdateBookmark", "getRenameRequest", "(", "String", "id", ",", "String", "newName", ")", "{", "BoxRequestsBookmark", ".", "UpdateBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "UpdateBookmark", "(", "id", ",", "g...
Gets a request that renames a bookmark @param id id of bookmark to rename @param newName id of bookmark to retrieve info on @return request to rename a bookmark
[ "Gets", "a", "request", "that", "renames", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L120-L124
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getMoveRequest
public BoxRequestsBookmark.UpdateBookmark getMoveRequest(String id, String parentId) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); request.setParentId(parentId); return request; }
java
public BoxRequestsBookmark.UpdateBookmark getMoveRequest(String id, String parentId) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession); request.setParentId(parentId); return request; }
[ "public", "BoxRequestsBookmark", ".", "UpdateBookmark", "getMoveRequest", "(", "String", "id", ",", "String", "parentId", ")", "{", "BoxRequestsBookmark", ".", "UpdateBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "UpdateBookmark", "(", "id", ",", "ge...
Gets a request that moves a bookmark to another folder @param id id of bookmark to move @param parentId id of parent folder to move bookmark into @return request to move a bookmark
[ "Gets", "a", "request", "that", "moves", "a", "bookmark", "to", "another", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L133-L137
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getDeleteRequest
public BoxRequestsBookmark.DeleteBookmark getDeleteRequest(String id) { BoxRequestsBookmark.DeleteBookmark request = new BoxRequestsBookmark.DeleteBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.DeleteBookmark getDeleteRequest(String id) { BoxRequestsBookmark.DeleteBookmark request = new BoxRequestsBookmark.DeleteBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "DeleteBookmark", "getDeleteRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "DeleteBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "DeleteBookmark", "(", "id", ",", "getBookmarkInfoUrl", "(", "id...
Gets a request that deletes a bookmark @param id id of bookmark to delete @return request to delete a bookmark
[ "Gets", "a", "request", "that", "deletes", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L145-L148
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getCreateSharedLinkRequest
public BoxRequestsBookmark.UpdateSharedBookmark getCreateSharedLinkRequest(String id) { BoxRequestsBookmark.UpdateSharedBookmark request = new BoxRequestsBookmark.UpdateSharedBookmark(id, getBookmarkInfoUrl(id), mSession) .setAccess(null); return request; }
java
public BoxRequestsBookmark.UpdateSharedBookmark getCreateSharedLinkRequest(String id) { BoxRequestsBookmark.UpdateSharedBookmark request = new BoxRequestsBookmark.UpdateSharedBookmark(id, getBookmarkInfoUrl(id), mSession) .setAccess(null); return request; }
[ "public", "BoxRequestsBookmark", ".", "UpdateSharedBookmark", "getCreateSharedLinkRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "UpdateSharedBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "UpdateSharedBookmark", "(", "id", ",", "getBo...
Gets a request that creates a shared link for a bookmark @param id id of bookmark to create shared link for @return request to create a shared link for a bookmark
[ "Gets", "a", "request", "that", "creates", "a", "shared", "link", "for", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L156-L160
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getDisableSharedLinkRequest
public BoxRequestsBookmark.UpdateBookmark getDisableSharedLinkRequest(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession) .setSharedLink(null); return request; }
java
public BoxRequestsBookmark.UpdateBookmark getDisableSharedLinkRequest(String id) { BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession) .setSharedLink(null); return request; }
[ "public", "BoxRequestsBookmark", ".", "UpdateBookmark", "getDisableSharedLinkRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "UpdateBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "UpdateBookmark", "(", "id", ",", "getBookmarkInfoUrl", ...
Gets a request that disables a shared link for a bookmark @param id id of bookmark to disable a shared link for @return request to create a shared link for a bookmark
[ "Gets", "a", "request", "that", "disables", "a", "shared", "link", "for", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L168-L172
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getAddCommentRequest
public BoxRequestsBookmark.AddCommentToBookmark getAddCommentRequest(String bookmarkId, String message) { BoxRequestsBookmark.AddCommentToBookmark request = new BoxRequestsBookmark.AddCommentToBookmark(bookmarkId, message, getCommentUrl(), mSession); return request; }
java
public BoxRequestsBookmark.AddCommentToBookmark getAddCommentRequest(String bookmarkId, String message) { BoxRequestsBookmark.AddCommentToBookmark request = new BoxRequestsBookmark.AddCommentToBookmark(bookmarkId, message, getCommentUrl(), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "AddCommentToBookmark", "getAddCommentRequest", "(", "String", "bookmarkId", ",", "String", "message", ")", "{", "BoxRequestsBookmark", ".", "AddCommentToBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "AddCommentToBookmar...
Gets a request that adds a comment to a bookmark @param bookmarkId id of the bookmark to add the comment to @param message message for the comment that will be added @return request to add a comment to a bookmark
[ "Gets", "a", "request", "that", "adds", "a", "comment", "to", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L181-L184
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getTrashedBookmarkRequest
public BoxRequestsBookmark.GetTrashedBookmark getTrashedBookmarkRequest(String id) { BoxRequestsBookmark.GetTrashedBookmark request = new BoxRequestsBookmark.GetTrashedBookmark(id, getTrashedBookmarkUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.GetTrashedBookmark getTrashedBookmarkRequest(String id) { BoxRequestsBookmark.GetTrashedBookmark request = new BoxRequestsBookmark.GetTrashedBookmark(id, getTrashedBookmarkUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "GetTrashedBookmark", "getTrashedBookmarkRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "GetTrashedBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "GetTrashedBookmark", "(", "id", ",", "getTrashedBo...
Gets a request that returns a bookmark in the trash @param id id of bookmark to get in the trash @return request to get a bookmark from the trash
[ "Gets", "a", "request", "that", "returns", "a", "bookmark", "in", "the", "trash" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L192-L195
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getDeleteTrashedBookmarkRequest
public BoxRequestsBookmark.DeleteTrashedBookmark getDeleteTrashedBookmarkRequest(String id) { BoxRequestsBookmark.DeleteTrashedBookmark request = new BoxRequestsBookmark.DeleteTrashedBookmark(id, getTrashedBookmarkUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.DeleteTrashedBookmark getDeleteTrashedBookmarkRequest(String id) { BoxRequestsBookmark.DeleteTrashedBookmark request = new BoxRequestsBookmark.DeleteTrashedBookmark(id, getTrashedBookmarkUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "DeleteTrashedBookmark", "getDeleteTrashedBookmarkRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "DeleteTrashedBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "DeleteTrashedBookmark", "(", "id", ",", ...
Gets a request that permanently deletes a bookmark from the trash @param id id of bookmark to delete from the trash @return request to permanently delete a bookmark from the trash
[ "Gets", "a", "request", "that", "permanently", "deletes", "a", "bookmark", "from", "the", "trash" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L203-L206
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getRestoreTrashedBookmarkRequest
public BoxRequestsBookmark.RestoreTrashedBookmark getRestoreTrashedBookmarkRequest(String id) { BoxRequestsBookmark.RestoreTrashedBookmark request = new BoxRequestsBookmark.RestoreTrashedBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.RestoreTrashedBookmark getRestoreTrashedBookmarkRequest(String id) { BoxRequestsBookmark.RestoreTrashedBookmark request = new BoxRequestsBookmark.RestoreTrashedBookmark(id, getBookmarkInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "RestoreTrashedBookmark", "getRestoreTrashedBookmarkRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "RestoreTrashedBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "RestoreTrashedBookmark", "(", "id", "...
Gets a request that restores a trashed bookmark @param id id of bookmark to restore @return request to restore a bookmark from the trash
[ "Gets", "a", "request", "that", "restores", "a", "trashed", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L214-L217
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getCommentsRequest
public BoxRequestsBookmark.GetBookmarkComments getCommentsRequest(String id) { BoxRequestsBookmark.GetBookmarkComments request = new BoxRequestsBookmark.GetBookmarkComments(id, getBookmarkCommentsUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.GetBookmarkComments getCommentsRequest(String id) { BoxRequestsBookmark.GetBookmarkComments request = new BoxRequestsBookmark.GetBookmarkComments(id, getBookmarkCommentsUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "GetBookmarkComments", "getCommentsRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "GetBookmarkComments", "request", "=", "new", "BoxRequestsBookmark", ".", "GetBookmarkComments", "(", "id", ",", "getBookmarkComme...
Gets a request that retrieves the comments on a bookmark @param id id of the bookmark to retrieve comments for @return request to retrieve comments on a bookmark
[ "Gets", "a", "request", "that", "retrieves", "the", "comments", "on", "a", "bookmark" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L225-L228
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getAddToCollectionRequest
public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) { BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkId, collectionId, getBookmarkInfoUrl(bookmarkId), mSession); return request; }
java
public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) { BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkId, collectionId, getBookmarkInfoUrl(bookmarkId), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "AddBookmarkToCollection", "getAddToCollectionRequest", "(", "String", "bookmarkId", ",", "String", "collectionId", ")", "{", "BoxRequestsBookmark", ".", "AddBookmarkToCollection", "request", "=", "new", "BoxRequestsBookmark", ".", "Add...
Gets a request that adds a bookmark to a collection @param bookmarkId id of bookmark to add to collection @param collectionId id of collection to add the bookmark to @return request to add a bookmark to a collection
[ "Gets", "a", "request", "that", "adds", "a", "bookmark", "to", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L237-L240
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getDeleteFromCollectionRequest
public BoxRequestsBookmark.DeleteBookmarkFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsBookmark.DeleteBookmarkFromCollection request = new BoxRequestsBookmark.DeleteBookmarkFromCollection(id, getBookmarkInfoUrl(id), mSession); return request; }
java
public BoxRequestsBookmark.DeleteBookmarkFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsBookmark.DeleteBookmarkFromCollection request = new BoxRequestsBookmark.DeleteBookmarkFromCollection(id, getBookmarkInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "DeleteBookmarkFromCollection", "getDeleteFromCollectionRequest", "(", "String", "id", ")", "{", "BoxRequestsBookmark", ".", "DeleteBookmarkFromCollection", "request", "=", "new", "BoxRequestsBookmark", ".", "DeleteBookmarkFromCollection", ...
Gets a request that removes a bookmark from a collection @param id id of bookmark to delete from the collection @return request to delete a bookmark from a collection
[ "Gets", "a", "request", "that", "removes", "a", "bookmark", "from", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L248-L251
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/RealTimeServerConnection.java
RealTimeServerConnection.connect
public BoxSimpleMessage connect() { mRetries = 0; try { BoxIteratorRealTimeServers servers = (BoxIteratorRealTimeServers)mRequest.send(); mBoxRealTimeServer = servers.get(0); } catch (BoxException e){ mChangeListener.onException(e, this); return null; } BoxRequestsEvent.LongPollMessageRequest messageRequest = new BoxRequestsEvent.LongPollMessageRequest(mBoxRealTimeServer.getUrl(),mSession); messageRequest.setTimeOut(mBoxRealTimeServer.getFieldRetryTimeout().intValue() * 1000 ); boolean shouldRetry = true; do { BoxFutureTask<BoxSimpleMessage> task = null; try { task = messageRequest.toTask().addOnCompletedListener(this); mExecutor.submit(task); BoxResponse<BoxSimpleMessage> response = task.get(mBoxRealTimeServer.getFieldRetryTimeout().intValue(), TimeUnit.SECONDS); if (response.isSuccess() && !response.getResult().getMessage().equals(BoxSimpleMessage.MESSAGE_RECONNECT)){ return response.getResult(); } } catch (TimeoutException e) { if (task != null) { try { // if the timeout is coming from the task then cancel the task (as httpurlconnection timeout is unreliable). task.cancel(true); } catch (CancellationException e1){ } } } catch (InterruptedException e){ mChangeListener.onException(e,this); } catch (ExecutionException e){ mChangeListener.onException(e,this); } mRetries++; if (mBoxRealTimeServer.getMaxRetries() < mRetries) { shouldRetry = false; } } while(shouldRetry); mChangeListener.onException(new BoxException.MaxAttemptsExceeded("Max retries exceeded, ", mRetries), this); return null; }
java
public BoxSimpleMessage connect() { mRetries = 0; try { BoxIteratorRealTimeServers servers = (BoxIteratorRealTimeServers)mRequest.send(); mBoxRealTimeServer = servers.get(0); } catch (BoxException e){ mChangeListener.onException(e, this); return null; } BoxRequestsEvent.LongPollMessageRequest messageRequest = new BoxRequestsEvent.LongPollMessageRequest(mBoxRealTimeServer.getUrl(),mSession); messageRequest.setTimeOut(mBoxRealTimeServer.getFieldRetryTimeout().intValue() * 1000 ); boolean shouldRetry = true; do { BoxFutureTask<BoxSimpleMessage> task = null; try { task = messageRequest.toTask().addOnCompletedListener(this); mExecutor.submit(task); BoxResponse<BoxSimpleMessage> response = task.get(mBoxRealTimeServer.getFieldRetryTimeout().intValue(), TimeUnit.SECONDS); if (response.isSuccess() && !response.getResult().getMessage().equals(BoxSimpleMessage.MESSAGE_RECONNECT)){ return response.getResult(); } } catch (TimeoutException e) { if (task != null) { try { // if the timeout is coming from the task then cancel the task (as httpurlconnection timeout is unreliable). task.cancel(true); } catch (CancellationException e1){ } } } catch (InterruptedException e){ mChangeListener.onException(e,this); } catch (ExecutionException e){ mChangeListener.onException(e,this); } mRetries++; if (mBoxRealTimeServer.getMaxRetries() < mRetries) { shouldRetry = false; } } while(shouldRetry); mChangeListener.onException(new BoxException.MaxAttemptsExceeded("Max retries exceeded, ", mRetries), this); return null; }
[ "public", "BoxSimpleMessage", "connect", "(", ")", "{", "mRetries", "=", "0", ";", "try", "{", "BoxIteratorRealTimeServers", "servers", "=", "(", "BoxIteratorRealTimeServers", ")", "mRequest", ".", "send", "(", ")", ";", "mBoxRealTimeServer", "=", "servers", "."...
Returns a message once a change has been detected or error occurs. Otherwise this method will continue reconnecting. @return A BoxSimpleMessage with a simple message indicating a change in the user's account.
[ "Returns", "a", "message", "once", "a", "change", "has", "been", "detected", "or", "error", "occurs", ".", "Otherwise", "this", "method", "will", "continue", "reconnecting", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/RealTimeServerConnection.java#L88-L131
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java
BoxRequestMultipart.putField
public void putField(String key, Date value) { this.fields.put(key, BoxDateFormat.format(value)); }
java
public void putField(String key, Date value) { this.fields.put(key, BoxDateFormat.format(value)); }
[ "public", "void", "putField", "(", "String", "key", ",", "Date", "value", ")", "{", "this", ".", "fields", ".", "put", "(", "key", ",", "BoxDateFormat", ".", "format", "(", "value", ")", ")", ";", "}" ]
Adds or updates a multipart field in this request. @param key the field's key. @param value the field's value.
[ "Adds", "or", "updates", "a", "multipart", "field", "in", "this", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java#L75-L77
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java
BoxRequestMultipart.setFile
public void setFile(InputStream inputStream, String filename, long fileSize) { this.setFile(inputStream, filename); this.fileSize = fileSize; }
java
public void setFile(InputStream inputStream, String filename, long fileSize) { this.setFile(inputStream, filename); this.fileSize = fileSize; }
[ "public", "void", "setFile", "(", "InputStream", "inputStream", ",", "String", "filename", ",", "long", "fileSize", ")", "{", "this", ".", "setFile", "(", "inputStream", ",", "filename", ")", ";", "this", ".", "fileSize", "=", "fileSize", ";", "}" ]
Sets the file contents of this request. @param inputStream a stream containing the file contents. @param filename the name of the file. @param fileSize the size of the file.
[ "Sets", "the", "file", "contents", "of", "this", "request", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java#L95-L98
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxRepresentation.java
BoxRepresentation.getRepresentationHintString
public static String getRepresentationHintString(String repType, String repSize) { StringBuffer sb = new StringBuffer(repType); if(TYPE_JPG.equals(repType) || TYPE_PNG.equals(repType)) { if(TextUtils.isEmpty(repSize)) { throw new InvalidParameterException("Size is not optional when creating representation hints for images"); } sb.append("?" + BoxRepPropertiesMap.FIELD_PROPERTIES_DIMENSIONS + "=" + repSize); } return sb.toString(); }
java
public static String getRepresentationHintString(String repType, String repSize) { StringBuffer sb = new StringBuffer(repType); if(TYPE_JPG.equals(repType) || TYPE_PNG.equals(repType)) { if(TextUtils.isEmpty(repSize)) { throw new InvalidParameterException("Size is not optional when creating representation hints for images"); } sb.append("?" + BoxRepPropertiesMap.FIELD_PROPERTIES_DIMENSIONS + "=" + repSize); } return sb.toString(); }
[ "public", "static", "String", "getRepresentationHintString", "(", "String", "repType", ",", "String", "repSize", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "repType", ")", ";", "if", "(", "TYPE_JPG", ".", "equals", "(", "repType", ")", ...
Helper method to generate representation hint string @param repType the type of representation @param repSize the size of representation, used for image types. (please refer to dimension string @return string that can be used on server requests hinting the type of representation to return
[ "Helper", "method", "to", "generate", "representation", "hint", "string" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxRepresentation.java#L165-L174
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxIteratorEnterpriseEvents.java
BoxIteratorEnterpriseEvents.getNextStreamPosition
public Long getNextStreamPosition() { String longValue = getPropertyAsString(FIELD_NEXT_STREAM_POSITION); return Long.parseLong(longValue.replace("\"", "")); }
java
public Long getNextStreamPosition() { String longValue = getPropertyAsString(FIELD_NEXT_STREAM_POSITION); return Long.parseLong(longValue.replace("\"", "")); }
[ "public", "Long", "getNextStreamPosition", "(", ")", "{", "String", "longValue", "=", "getPropertyAsString", "(", "FIELD_NEXT_STREAM_POSITION", ")", ";", "return", "Long", ".", "parseLong", "(", "longValue", ".", "replace", "(", "\"\\\"\"", ",", "\"\"", ")", ")"...
Gets the next position in the event stream that you should request in order to get the next events. @return next position in the event stream to request in order to get the next events.
[ "Gets", "the", "next", "position", "in", "the", "event", "stream", "that", "you", "should", "request", "in", "order", "to", "get", "the", "next", "events", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxIteratorEnterpriseEvents.java#L31-L34
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFile.java
BoxFile.createFromIdAndName
public static BoxFile createFromIdAndName(String fileId, String name) { JsonObject object = new JsonObject(); object.add(BoxItem.FIELD_ID, fileId); object.add(BoxItem.FIELD_TYPE, BoxFile.TYPE); if (!TextUtils.isEmpty(name)) { object.add(BoxItem.FIELD_NAME, name); } return new BoxFile(object); }
java
public static BoxFile createFromIdAndName(String fileId, String name) { JsonObject object = new JsonObject(); object.add(BoxItem.FIELD_ID, fileId); object.add(BoxItem.FIELD_TYPE, BoxFile.TYPE); if (!TextUtils.isEmpty(name)) { object.add(BoxItem.FIELD_NAME, name); } return new BoxFile(object); }
[ "public", "static", "BoxFile", "createFromIdAndName", "(", "String", "fileId", ",", "String", "name", ")", "{", "JsonObject", "object", "=", "new", "JsonObject", "(", ")", ";", "object", ".", "add", "(", "BoxItem", ".", "FIELD_ID", ",", "fileId", ")", ";",...
A convenience method to create an empty file with just the id and type fields set. This allows the ability to interact with the content sdk in a more descriptive and type safe manner @param fileId the id of file to create @param name the name of the file to create @return an empty BoxFile object that only contains id and type information
[ "A", "convenience", "method", "to", "create", "an", "empty", "file", "with", "just", "the", "id", "and", "type", "fields", "set", ".", "This", "allows", "the", "ability", "to", "interact", "with", "the", "content", "sdk", "in", "a", "more", "descriptive", ...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxFile.java#L103-L111
train
box/box-android-sdk
box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java
MainActivity.loadRootFolder
private void loadRootFolder() { new Thread() { @Override public void run() { try { //Api to fetch root folder final BoxIteratorItems folderItems = mFolderApi.getItemsRequest(BoxConstants.ROOT_FOLDER_ID).send(); runOnUiThread(new Runnable() { @Override public void run() { mAdapter.clear(); for (BoxItem boxItem: folderItems) { mAdapter.add(boxItem); } } }); } catch (BoxException e) { e.printStackTrace(); } } }.start(); }
java
private void loadRootFolder() { new Thread() { @Override public void run() { try { //Api to fetch root folder final BoxIteratorItems folderItems = mFolderApi.getItemsRequest(BoxConstants.ROOT_FOLDER_ID).send(); runOnUiThread(new Runnable() { @Override public void run() { mAdapter.clear(); for (BoxItem boxItem: folderItems) { mAdapter.add(boxItem); } } }); } catch (BoxException e) { e.printStackTrace(); } } }.start(); }
[ "private", "void", "loadRootFolder", "(", ")", "{", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "//Api to fetch root folder", "final", "BoxIteratorItems", "folderItems", "=", "mFolderApi", ".", "getItems...
Method to demonstrate fetching folder items from the root folder
[ "Method", "to", "demonstrate", "fetching", "folder", "items", "from", "the", "root", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java#L123-L145
train
box/box-android-sdk
box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java
MainActivity.uploadSampleFile
private void uploadSampleFile() { mDialog = ProgressDialog.show(MainActivity.this, getText(R.string.boxsdk_Please_wait), getText(R.string.boxsdk_Please_wait)); new Thread() { @Override public void run() { try { String uploadFileName = "box_logo.png"; InputStream uploadStream = getResources().getAssets().open(uploadFileName); String destinationFolderId = "0"; String uploadName = "BoxSDKUpload.png"; BoxRequestsFile.UploadFile request = mFileApi.getUploadRequest(uploadStream, uploadName, destinationFolderId); final BoxFile uploadFileInfo = request.send(); showToast("Uploaded " + uploadFileInfo.getName()); loadRootFolder(); } catch (IOException e) { e.printStackTrace(); } catch (BoxException e) { e.printStackTrace(); BoxError error = e.getAsBoxError(); if (error != null && error.getStatus() == HttpURLConnection.HTTP_CONFLICT) { ArrayList<BoxEntity> conflicts = error.getContextInfo().getConflicts(); if (conflicts != null && conflicts.size() == 1 && conflicts.get(0) instanceof BoxFile) { uploadNewVersion((BoxFile) conflicts.get(0)); return; } } showToast("Upload failed"); } finally { mDialog.dismiss(); } } }.start(); }
java
private void uploadSampleFile() { mDialog = ProgressDialog.show(MainActivity.this, getText(R.string.boxsdk_Please_wait), getText(R.string.boxsdk_Please_wait)); new Thread() { @Override public void run() { try { String uploadFileName = "box_logo.png"; InputStream uploadStream = getResources().getAssets().open(uploadFileName); String destinationFolderId = "0"; String uploadName = "BoxSDKUpload.png"; BoxRequestsFile.UploadFile request = mFileApi.getUploadRequest(uploadStream, uploadName, destinationFolderId); final BoxFile uploadFileInfo = request.send(); showToast("Uploaded " + uploadFileInfo.getName()); loadRootFolder(); } catch (IOException e) { e.printStackTrace(); } catch (BoxException e) { e.printStackTrace(); BoxError error = e.getAsBoxError(); if (error != null && error.getStatus() == HttpURLConnection.HTTP_CONFLICT) { ArrayList<BoxEntity> conflicts = error.getContextInfo().getConflicts(); if (conflicts != null && conflicts.size() == 1 && conflicts.get(0) instanceof BoxFile) { uploadNewVersion((BoxFile) conflicts.get(0)); return; } } showToast("Upload failed"); } finally { mDialog.dismiss(); } } }.start(); }
[ "private", "void", "uploadSampleFile", "(", ")", "{", "mDialog", "=", "ProgressDialog", ".", "show", "(", "MainActivity", ".", "this", ",", "getText", "(", "R", ".", "string", ".", "boxsdk_Please_wait", ")", ",", "getText", "(", "R", ".", "string", ".", ...
Method demonstrates a sample file being uploaded using the file api
[ "Method", "demonstrates", "a", "sample", "file", "being", "uploaded", "using", "the", "file", "api" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java#L150-L183
train
box/box-android-sdk
box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java
MainActivity.uploadNewVersion
private void uploadNewVersion(final BoxFile file) { new Thread() { @Override public void run() { try { String uploadFileName = "box_logo.png"; InputStream uploadStream = getResources().getAssets().open(uploadFileName); BoxRequestsFile.UploadNewVersion request = mFileApi.getUploadNewVersionRequest(uploadStream, file.getId()); final BoxFile uploadFileVersionInfo = request.send(); showToast("Uploaded new version of " + uploadFileVersionInfo.getName()); } catch (IOException e) { e.printStackTrace(); } catch (BoxException e) { e.printStackTrace(); showToast("Upload failed"); } finally { mDialog.dismiss(); } } }.start(); }
java
private void uploadNewVersion(final BoxFile file) { new Thread() { @Override public void run() { try { String uploadFileName = "box_logo.png"; InputStream uploadStream = getResources().getAssets().open(uploadFileName); BoxRequestsFile.UploadNewVersion request = mFileApi.getUploadNewVersionRequest(uploadStream, file.getId()); final BoxFile uploadFileVersionInfo = request.send(); showToast("Uploaded new version of " + uploadFileVersionInfo.getName()); } catch (IOException e) { e.printStackTrace(); } catch (BoxException e) { e.printStackTrace(); showToast("Upload failed"); } finally { mDialog.dismiss(); } } }.start(); }
[ "private", "void", "uploadNewVersion", "(", "final", "BoxFile", "file", ")", "{", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "String", "uploadFileName", "=", "\"box_logo.png\"", ";", "InputStream", ...
Method demonstrates a new version of a file being uploaded using the file api @param file
[ "Method", "demonstrates", "a", "new", "version", "of", "a", "file", "being", "uploaded", "using", "the", "file", "api" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sample/src/main/java/com/box/androidsdk/sample/MainActivity.java#L189-L209
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.copyStream
public static void copyStream(final InputStream inputStream, final OutputStream outputStream) throws IOException, InterruptedException { copyStream(inputStream, outputStream, null); }
java
public static void copyStream(final InputStream inputStream, final OutputStream outputStream) throws IOException, InterruptedException { copyStream(inputStream, outputStream, null); }
[ "public", "static", "void", "copyStream", "(", "final", "InputStream", "inputStream", ",", "final", "OutputStream", "outputStream", ")", "throws", "IOException", ",", "InterruptedException", "{", "copyStream", "(", "inputStream", ",", "outputStream", ",", "null", ")...
Utility method to write given inputStream to given outputStream. @param inputStream the inputStream to copy from. @param outputStream the outputStream to write to. @throws IOException thrown if there was a problem reading from inputStream or writing to outputStream. @throws InterruptedException thrown if the thread is interrupted which indicates cancelling.
[ "Utility", "method", "to", "write", "given", "inputStream", "to", "given", "outputStream", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L74-L77
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.copyStreamAndComputeSha1
public static String copyStreamAndComputeSha1(final InputStream inputStream, final OutputStream outputStream) throws NoSuchAlgorithmException, IOException, InterruptedException { MessageDigest md = MessageDigest.getInstance("SHA-1"); copyStream(inputStream, outputStream, md); return new String(encodeHex(md.digest())); }
java
public static String copyStreamAndComputeSha1(final InputStream inputStream, final OutputStream outputStream) throws NoSuchAlgorithmException, IOException, InterruptedException { MessageDigest md = MessageDigest.getInstance("SHA-1"); copyStream(inputStream, outputStream, md); return new String(encodeHex(md.digest())); }
[ "public", "static", "String", "copyStreamAndComputeSha1", "(", "final", "InputStream", "inputStream", ",", "final", "OutputStream", "outputStream", ")", "throws", "NoSuchAlgorithmException", ",", "IOException", ",", "InterruptedException", "{", "MessageDigest", "md", "=",...
Utility method to write given inputStream to given outputStream and compute the sha1 while transferring the bytes @param inputStream the inputStream to copy from. @param outputStream the outputStream to write to. @return @throws IOException thrown if there was a problem reading from inputStream or writing to outputStream. @throws InterruptedException thrown if the thread is interrupted which indicates cancelling.
[ "Utility", "method", "to", "write", "given", "inputStream", "to", "given", "outputStream", "and", "compute", "the", "sha1", "while", "transferring", "the", "bytes" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L88-L93
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.copyStream
private static void copyStream(final InputStream inputStream, final OutputStream outputStream, MessageDigest messageDigest) throws IOException, InterruptedException { // Read the rest of the stream and write to the destination OutputStream. final byte[] buffer = new byte[BUFFER_SIZE]; int bufferLength = 0; Exception exception = null; try { while ((bufferLength = inputStream.read(buffer)) > 0) { if (Thread.currentThread().isInterrupted()) { InterruptedException e = new InterruptedException(); throw e; } outputStream.write(buffer, 0, bufferLength); if (messageDigest != null) { messageDigest.update(buffer, 0, bufferLength); } } } catch (Exception e) { exception = e; if (exception instanceof IOException) { throw (IOException) e; } if (exception instanceof InterruptedException) { throw (InterruptedException) e; } } finally { // Try to flush the OutputStream if (exception == null) { outputStream.flush(); } } }
java
private static void copyStream(final InputStream inputStream, final OutputStream outputStream, MessageDigest messageDigest) throws IOException, InterruptedException { // Read the rest of the stream and write to the destination OutputStream. final byte[] buffer = new byte[BUFFER_SIZE]; int bufferLength = 0; Exception exception = null; try { while ((bufferLength = inputStream.read(buffer)) > 0) { if (Thread.currentThread().isInterrupted()) { InterruptedException e = new InterruptedException(); throw e; } outputStream.write(buffer, 0, bufferLength); if (messageDigest != null) { messageDigest.update(buffer, 0, bufferLength); } } } catch (Exception e) { exception = e; if (exception instanceof IOException) { throw (IOException) e; } if (exception instanceof InterruptedException) { throw (InterruptedException) e; } } finally { // Try to flush the OutputStream if (exception == null) { outputStream.flush(); } } }
[ "private", "static", "void", "copyStream", "(", "final", "InputStream", "inputStream", ",", "final", "OutputStream", "outputStream", ",", "MessageDigest", "messageDigest", ")", "throws", "IOException", ",", "InterruptedException", "{", "// Read the rest of the stream and wr...
Utility method to write given inputStream to given outputStream and update the messageDigest while transferring the bytes @param inputStream the inputStream to copy from. @param outputStream the outputStream to write to. @param messageDigest messageDigest to update with the outpu @throws IOException thrown if there was a problem reading from inputStream or writing to outputStream. @throws InterruptedException thrown if the thread is interrupted which indicates cancelling.
[ "Utility", "method", "to", "write", "given", "inputStream", "to", "given", "outputStream", "and", "update", "the", "messageDigest", "while", "transferring", "the", "bytes" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L104-L136
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.createArrayOutputStream
public static OutputStream createArrayOutputStream(final OutputStream[] outputStreams) { return new OutputStream() { @Override public void close() throws IOException { for (OutputStream o : outputStreams) { o.close(); } super.close(); } @Override public void flush() throws IOException { for (OutputStream o : outputStreams) { o.flush(); } super.flush(); } @Override public void write(int oneByte) throws IOException { for (OutputStream o : outputStreams) { o.write(oneByte); } } @Override public void write(byte[] buffer) throws IOException { for (OutputStream o : outputStreams) { o.write(buffer); } } @Override public void write(byte[] buffer, int offset, int count) throws IOException { for (OutputStream o : outputStreams) { o.write(buffer, offset, count); } } }; }
java
public static OutputStream createArrayOutputStream(final OutputStream[] outputStreams) { return new OutputStream() { @Override public void close() throws IOException { for (OutputStream o : outputStreams) { o.close(); } super.close(); } @Override public void flush() throws IOException { for (OutputStream o : outputStreams) { o.flush(); } super.flush(); } @Override public void write(int oneByte) throws IOException { for (OutputStream o : outputStreams) { o.write(oneByte); } } @Override public void write(byte[] buffer) throws IOException { for (OutputStream o : outputStreams) { o.write(buffer); } } @Override public void write(byte[] buffer, int offset, int count) throws IOException { for (OutputStream o : outputStreams) { o.write(buffer, offset, count); } } }; }
[ "public", "static", "OutputStream", "createArrayOutputStream", "(", "final", "OutputStream", "[", "]", "outputStreams", ")", "{", "return", "new", "OutputStream", "(", ")", "{", "@", "Override", "public", "void", "close", "(", ")", "throws", "IOException", "{", ...
Helper method that wraps given arrays inside of a single outputstream. @param outputStreams an array of multiple outputstreams. @return a single outputstream that will write to provided outputstreams.
[ "Helper", "method", "that", "wraps", "given", "arrays", "inside", "of", "a", "single", "outputstream", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L144-L187
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.sha1
public static String sha1(final InputStream inputStream) throws IOException, NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] bytes = new byte[8192]; int byteCount; while ((byteCount = inputStream.read(bytes)) > 0) { md.update(bytes, 0, byteCount); } inputStream.close(); return new String(encodeHex(md.digest())); }
java
public static String sha1(final InputStream inputStream) throws IOException, NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] bytes = new byte[8192]; int byteCount; while ((byteCount = inputStream.read(bytes)) > 0) { md.update(bytes, 0, byteCount); } inputStream.close(); return new String(encodeHex(md.digest())); }
[ "public", "static", "String", "sha1", "(", "final", "InputStream", "inputStream", ")", "throws", "IOException", ",", "NoSuchAlgorithmException", "{", "MessageDigest", "md", "=", "MessageDigest", ".", "getInstance", "(", "\"SHA-1\"", ")", ";", "byte", "[", "]", "...
Utilitiy method to calculate sha1 based on given inputStream. @param inputStream InputStream of file to calculate sha1 for. @return the calculated sha1 for given stream. @throws IOException thrown if there was issue getting stream content. @throws NoSuchAlgorithmException thrown if Sha-1 algorithm implementation is not supported by OS.
[ "Utilitiy", "method", "to", "calculate", "sha1", "based", "on", "given", "inputStream", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L227-L237
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.parseJsonValueToLong
public static long parseJsonValueToLong(JsonValue value) { try { return value.asLong(); } catch (UnsupportedOperationException e) { String s = value.asString().replace("\"", ""); return Long.parseLong(s); } }
java
public static long parseJsonValueToLong(JsonValue value) { try { return value.asLong(); } catch (UnsupportedOperationException e) { String s = value.asString().replace("\"", ""); return Long.parseLong(s); } }
[ "public", "static", "long", "parseJsonValueToLong", "(", "JsonValue", "value", ")", "{", "try", "{", "return", "value", ".", "asLong", "(", ")", ";", "}", "catch", "(", "UnsupportedOperationException", "e", ")", "{", "String", "s", "=", "value", ".", "asSt...
Parse a given JsonValue to a long regardless of whether that value is a String or a long. @param value a JsonValue to parse to a long. @return a long representation of the given value. Can throw a runtime exception (ParseException, UnsupportedOperationException, or NumberFormatException).
[ "Parse", "a", "given", "JsonValue", "to", "a", "long", "regardless", "of", "whether", "that", "value", "is", "a", "String", "or", "a", "long", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L259-L266
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.parseJsonValueToInteger
public static long parseJsonValueToInteger(JsonValue value) { try { return value.asInt(); } catch (UnsupportedOperationException e) { String s = value.asString().replace("\"", ""); return Integer.parseInt(s); } }
java
public static long parseJsonValueToInteger(JsonValue value) { try { return value.asInt(); } catch (UnsupportedOperationException e) { String s = value.asString().replace("\"", ""); return Integer.parseInt(s); } }
[ "public", "static", "long", "parseJsonValueToInteger", "(", "JsonValue", "value", ")", "{", "try", "{", "return", "value", ".", "asInt", "(", ")", ";", "}", "catch", "(", "UnsupportedOperationException", "e", ")", "{", "String", "s", "=", "value", ".", "as...
Parse a given JsonValue to an int regardless of whether that value is a String or an int. @param value a JsonValue to parse to an int. @return an int representation of the given value. Can throw a runtime exception (ParseException, UnsupportedOperationException, or NumberFormatException).
[ "Parse", "a", "given", "JsonValue", "to", "an", "int", "regardless", "of", "whether", "that", "value", "is", "a", "String", "or", "an", "int", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L274-L281
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.concatStringWithDelimiter
public static String concatStringWithDelimiter(String[] strings, String delimiter) { StringBuilder sbr = new StringBuilder(); int size = strings.length; for (int i = 0; i < size - 1; i++) { sbr.append(strings[i]).append(delimiter); } sbr.append(strings[size - 1]); return sbr.toString(); }
java
public static String concatStringWithDelimiter(String[] strings, String delimiter) { StringBuilder sbr = new StringBuilder(); int size = strings.length; for (int i = 0; i < size - 1; i++) { sbr.append(strings[i]).append(delimiter); } sbr.append(strings[size - 1]); return sbr.toString(); }
[ "public", "static", "String", "concatStringWithDelimiter", "(", "String", "[", "]", "strings", ",", "String", "delimiter", ")", "{", "StringBuilder", "sbr", "=", "new", "StringBuilder", "(", ")", ";", "int", "size", "=", "strings", ".", "length", ";", "for",...
Utility method to create a large String with the given delimiter. @param strings Strings to concatenate. @param delimiter The delimiter to use to put between each string item. @return a large string with all items separated by given delimiter.
[ "Utility", "method", "to", "create", "a", "large", "String", "with", "the", "given", "delimiter", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L290-L298
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.cloneSerializable
public static <T extends Object> T cloneSerializable(T source) { ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; ByteArrayInputStream bais = null; ObjectInputStream ois = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(source); bais = new ByteArrayInputStream(baos.toByteArray()); ois = new ObjectInputStream(bais); return (T) ois.readObject(); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { return null; } finally { closeQuietly(baos, oos, bais, ois); } }
java
public static <T extends Object> T cloneSerializable(T source) { ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; ByteArrayInputStream bais = null; ObjectInputStream ois = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(source); bais = new ByteArrayInputStream(baos.toByteArray()); ois = new ObjectInputStream(bais); return (T) ois.readObject(); } catch (IOException e) { return null; } catch (ClassNotFoundException e) { return null; } finally { closeQuietly(baos, oos, bais, ois); } }
[ "public", "static", "<", "T", "extends", "Object", ">", "T", "cloneSerializable", "(", "T", "source", ")", "{", "ByteArrayOutputStream", "baos", "=", "null", ";", "ObjectOutputStream", "oos", "=", "null", ";", "ByteArrayInputStream", "bais", "=", "null", ";", ...
Helper method to clone a serializable object. @param source the serializable object to clone. @param <T> The class of the serializable object. @return a clone of the given source object.
[ "Helper", "method", "to", "clone", "a", "serializable", "object", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L330-L350
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.convertSerializableToString
public static String convertSerializableToString(Serializable obj) { ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(obj); return new String(baos.toByteArray()); } catch (IOException e) { return null; } finally { closeQuietly(baos, oos); closeQuietly(oos); } }
java
public static String convertSerializableToString(Serializable obj) { ByteArrayOutputStream baos = null; ObjectOutputStream oos = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(obj); return new String(baos.toByteArray()); } catch (IOException e) { return null; } finally { closeQuietly(baos, oos); closeQuietly(oos); } }
[ "public", "static", "String", "convertSerializableToString", "(", "Serializable", "obj", ")", "{", "ByteArrayOutputStream", "baos", "=", "null", ";", "ObjectOutputStream", "oos", "=", "null", ";", "try", "{", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ...
Helper method to write a serializable object into a String. @param obj the Serializable object @return a String representation of obj.
[ "Helper", "method", "to", "write", "a", "serializable", "object", "into", "a", "String", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L358-L373
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.deleteFolderRecursive
public static boolean deleteFolderRecursive(final File f) { if (f.isDirectory()) { File[] files = f.listFiles(); if (files == null) { return false; } for (File c : files) { deleteFolderRecursive(c); } } return f.delete(); }
java
public static boolean deleteFolderRecursive(final File f) { if (f.isDirectory()) { File[] files = f.listFiles(); if (files == null) { return false; } for (File c : files) { deleteFolderRecursive(c); } } return f.delete(); }
[ "public", "static", "boolean", "deleteFolderRecursive", "(", "final", "File", "f", ")", "{", "if", "(", "f", ".", "isDirectory", "(", ")", ")", "{", "File", "[", "]", "files", "=", "f", ".", "listFiles", "(", ")", ";", "if", "(", "files", "==", "nu...
Recursively delete a folder and all its subfolders and files. @param f directory to be deleted. @return True if the folder was deleted.
[ "Recursively", "delete", "a", "folder", "and", "all", "its", "subfolders", "and", "files", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L396-L407
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.isInternetAvailable
public static boolean isInternetAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return isInternetAvailable(connectivityManager); } else { return isInternetAvailablePreLollipop(connectivityManager); } }
java
public static boolean isInternetAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return isInternetAvailable(connectivityManager); } else { return isInternetAvailablePreLollipop(connectivityManager); } }
[ "public", "static", "boolean", "isInternetAvailable", "(", "Context", "context", ")", "{", "ConnectivityManager", "connectivityManager", "=", "(", "ConnectivityManager", ")", "context", ".", "getApplicationContext", "(", ")", ".", "getSystemService", "(", "Context", "...
Check for an internet connection. @param context current context. @return whether or not there is a valid internet connection
[ "Check", "for", "an", "internet", "connection", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L415-L422
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.getAssetFile
public static String getAssetFile(final Context context, final String assetName) { // if the file is not found create it and return that. // if we do not have a file we copy our asset out to create one. AssetManager assetManager = context.getAssets(); BufferedReader in = null; try { StringBuilder buf = new StringBuilder(); InputStream is = assetManager.open(assetName); in = new BufferedReader(new InputStreamReader(is)); String str; boolean isFirst = true; while ((str = in.readLine()) != null) { if (isFirst) isFirst = false; else buf.append('\n'); buf.append(str); } return buf.toString(); } catch (IOException e) { BoxLogUtils.e("getAssetFile", assetName, e); } finally { try { if (in != null) { in.close(); } } catch (Exception e) { BoxLogUtils.e("getAssetFile", assetName, e); } } // should never get here unless the asset file is inaccessible or cannot be copied out. return null; }
java
public static String getAssetFile(final Context context, final String assetName) { // if the file is not found create it and return that. // if we do not have a file we copy our asset out to create one. AssetManager assetManager = context.getAssets(); BufferedReader in = null; try { StringBuilder buf = new StringBuilder(); InputStream is = assetManager.open(assetName); in = new BufferedReader(new InputStreamReader(is)); String str; boolean isFirst = true; while ((str = in.readLine()) != null) { if (isFirst) isFirst = false; else buf.append('\n'); buf.append(str); } return buf.toString(); } catch (IOException e) { BoxLogUtils.e("getAssetFile", assetName, e); } finally { try { if (in != null) { in.close(); } } catch (Exception e) { BoxLogUtils.e("getAssetFile", assetName, e); } } // should never get here unless the asset file is inaccessible or cannot be copied out. return null; }
[ "public", "static", "String", "getAssetFile", "(", "final", "Context", "context", ",", "final", "String", "assetName", ")", "{", "// if the file is not found create it and return that.", "// if we do not have a file we copy our asset out to create one.", "AssetManager", "assetManag...
Helper method for reading an asset file into a string. @param context current context. @param assetName the asset name @return a string representation of a file in assets.
[ "Helper", "method", "for", "reading", "an", "asset", "file", "into", "a", "string", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L453-L486
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.toastSafely
public static void toastSafely(final Context context, final int resId, final int duration) { Long lastToastTime = LAST_TOAST_TIME.get(resId); if (lastToastTime != null && (lastToastTime + TOAST_MIN_REPEAT_DELAY) < System.currentTimeMillis()) { return; } Looper mainLooper = Looper.getMainLooper(); if (Thread.currentThread().equals(mainLooper.getThread())) { LAST_TOAST_TIME.put(resId, System.currentTimeMillis()); Toast.makeText(context, resId, duration).show(); } else { Handler handler = new Handler(mainLooper); handler.post(new Runnable() { @Override public void run() { LAST_TOAST_TIME.put(resId, System.currentTimeMillis()); Toast.makeText(context, resId, duration).show(); } }); } }
java
public static void toastSafely(final Context context, final int resId, final int duration) { Long lastToastTime = LAST_TOAST_TIME.get(resId); if (lastToastTime != null && (lastToastTime + TOAST_MIN_REPEAT_DELAY) < System.currentTimeMillis()) { return; } Looper mainLooper = Looper.getMainLooper(); if (Thread.currentThread().equals(mainLooper.getThread())) { LAST_TOAST_TIME.put(resId, System.currentTimeMillis()); Toast.makeText(context, resId, duration).show(); } else { Handler handler = new Handler(mainLooper); handler.post(new Runnable() { @Override public void run() { LAST_TOAST_TIME.put(resId, System.currentTimeMillis()); Toast.makeText(context, resId, duration).show(); } }); } }
[ "public", "static", "void", "toastSafely", "(", "final", "Context", "context", ",", "final", "int", "resId", ",", "final", "int", "duration", ")", "{", "Long", "lastToastTime", "=", "LAST_TOAST_TIME", ".", "get", "(", "resId", ")", ";", "if", "(", "lastToa...
Helper method for showing a toast message checking to see if user is on ui thread, and not showing the same toast if it has already been shown within TOAST_MIN_REPEAT_DELAY time. @param context current context. @param resId string resource id to display. @param duration Toast.LENGTH_LONG or Toast.LENGTH_SHORT.
[ "Helper", "method", "for", "showing", "a", "toast", "message", "checking", "to", "see", "if", "user", "is", "on", "ui", "thread", "and", "not", "showing", "the", "same", "toast", "if", "it", "has", "already", "been", "shown", "within", "TOAST_MIN_REPEAT_DELA...
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L523-L542
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.setInitialsThumb
public static void setInitialsThumb(Context context, TextView initialsView, String fullName) { char initial1 = '\u0000'; char initial2 = '\u0000'; if (fullName != null) { String[] nameParts = fullName.split(" "); if (nameParts[0].length() > 0) { initial1 = nameParts[0].charAt(0); } if (nameParts.length > 1) { initial2 = nameParts[nameParts.length - 1].charAt(0); } } setColorForInitialsThumb(initialsView, initial1 + initial2); initialsView.setText(initial1 + "" + initial2); initialsView.setTextColor(Color.WHITE); }
java
public static void setInitialsThumb(Context context, TextView initialsView, String fullName) { char initial1 = '\u0000'; char initial2 = '\u0000'; if (fullName != null) { String[] nameParts = fullName.split(" "); if (nameParts[0].length() > 0) { initial1 = nameParts[0].charAt(0); } if (nameParts.length > 1) { initial2 = nameParts[nameParts.length - 1].charAt(0); } } setColorForInitialsThumb(initialsView, initial1 + initial2); initialsView.setText(initial1 + "" + initial2); initialsView.setTextColor(Color.WHITE); }
[ "public", "static", "void", "setInitialsThumb", "(", "Context", "context", ",", "TextView", "initialsView", ",", "String", "fullName", ")", "{", "char", "initial1", "=", "'", "'", ";", "char", "initial2", "=", "'", "'", ";", "if", "(", "fullName", "!=", ...
Helper method used to display initials into a given textview. @param context current context @param initialsView TextView used to set initials into. @param fullName The user's full name to create initials for.
[ "Helper", "method", "used", "to", "display", "initials", "into", "a", "given", "textview", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L551-L566
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.setCollabNumberThumb
public static void setCollabNumberThumb(Context context, TextView initialsView, int collabNumber) { String collabNumberDisplay = (collabNumber >= 100) ? "+99" : "+" + Integer.toString(collabNumber); setColorForCollabNumberThumb(initialsView); initialsView.setTextColor(COLLAB_NUMBER_THUMB_COLOR); initialsView.setText(collabNumberDisplay); }
java
public static void setCollabNumberThumb(Context context, TextView initialsView, int collabNumber) { String collabNumberDisplay = (collabNumber >= 100) ? "+99" : "+" + Integer.toString(collabNumber); setColorForCollabNumberThumb(initialsView); initialsView.setTextColor(COLLAB_NUMBER_THUMB_COLOR); initialsView.setText(collabNumberDisplay); }
[ "public", "static", "void", "setCollabNumberThumb", "(", "Context", "context", ",", "TextView", "initialsView", ",", "int", "collabNumber", ")", "{", "String", "collabNumberDisplay", "=", "(", "collabNumber", ">=", "100", ")", "?", "\"+99\"", ":", "\"+\"", "+", ...
Helper method to display number of collaborators. If there are more than 99 collaborators it would show "99+" due to the width constraint in the view. @param context current context @param initialsView TextView used to display number of collaborators @param collabNumber Number of collaborators
[ "Helper", "method", "to", "display", "number", "of", "collaborators", ".", "If", "there", "are", "more", "than", "99", "collaborators", "it", "would", "show", "99", "+", "due", "to", "the", "width", "constraint", "in", "the", "view", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L576-L581
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.setColorsThumb
public static void setColorsThumb(TextView initialsView, int backgroundColor, int strokeColor) { GradientDrawable drawable = (GradientDrawable) initialsView.getResources().getDrawable(R.drawable.boxsdk_thumb_background); drawable.setColorFilter(backgroundColor, PorterDuff.Mode.MULTIPLY); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { drawable.setStroke(3, strokeColor); initialsView.setBackground(drawable); } else { drawable.setStroke(3, strokeColor); initialsView.setBackgroundDrawable(drawable); } }
java
public static void setColorsThumb(TextView initialsView, int backgroundColor, int strokeColor) { GradientDrawable drawable = (GradientDrawable) initialsView.getResources().getDrawable(R.drawable.boxsdk_thumb_background); drawable.setColorFilter(backgroundColor, PorterDuff.Mode.MULTIPLY); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { drawable.setStroke(3, strokeColor); initialsView.setBackground(drawable); } else { drawable.setStroke(3, strokeColor); initialsView.setBackgroundDrawable(drawable); } }
[ "public", "static", "void", "setColorsThumb", "(", "TextView", "initialsView", ",", "int", "backgroundColor", ",", "int", "strokeColor", ")", "{", "GradientDrawable", "drawable", "=", "(", "GradientDrawable", ")", "initialsView", ".", "getResources", "(", ")", "."...
Sets the the background thumb color for the account view to one of the material colors @param initialsView view where the thumbs will be shown
[ "Sets", "the", "the", "background", "thumb", "color", "for", "the", "account", "view", "to", "one", "of", "the", "material", "colors" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L599-L609
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.setColorForInitialsThumb
public static void setColorForInitialsThumb(TextView initialsView, int position) { int backgroundColor = THUMB_COLORS[(position) % THUMB_COLORS.length]; setColorsThumb(initialsView, backgroundColor, Color.WHITE); }
java
public static void setColorForInitialsThumb(TextView initialsView, int position) { int backgroundColor = THUMB_COLORS[(position) % THUMB_COLORS.length]; setColorsThumb(initialsView, backgroundColor, Color.WHITE); }
[ "public", "static", "void", "setColorForInitialsThumb", "(", "TextView", "initialsView", ",", "int", "position", ")", "{", "int", "backgroundColor", "=", "THUMB_COLORS", "[", "(", "position", ")", "%", "THUMB_COLORS", ".", "length", "]", ";", "setColorsThumb", "...
Sets the thumb color that displays users initials @param initialsView TextView used to display number of collaborators @param position Used to pick a material color from an array
[ "Sets", "the", "thumb", "color", "that", "displays", "users", "initials" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L617-L620
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java
SdkUtils.getLocalizedFileSize
public static String getLocalizedFileSize(final Context context, double numSize) { String localeLanguage = Locale.getDefault().getLanguage(); if (!SIZE_LANGUAGE.equals(localeLanguage) && context != null && context.getResources() != null) { Resources resources = context.getResources(); SIZE_BYTES = resources.getString(R.string.boxsdk_bytes); SIZE_KILOBYTES = resources.getString(R.string.boxsdk_kilobytes); SIZE_MEGABYTES = resources.getString(R.string.boxsdk_megabytes); SIZE_GIGABYTES = resources.getString(R.string.boxsdk_gigabytes); SIZE_TERABYTES = resources.getString(R.string.boxsdk_terabytes); SIZE_LANGUAGE = localeLanguage; } String textSize = null; double size; if (numSize < constKB) { textSize = String.format(Locale.getDefault(), SIZE_BYTES, numSize); } else if ((numSize >= constKB) && (numSize < constMB)) { size = numSize / floatKB; textSize = String.format(Locale.getDefault(), SIZE_KILOBYTES, size); } else if ((numSize >= constMB) && (numSize < constGB)) { size = numSize / floatMB; textSize = String.format(Locale.getDefault(), SIZE_MEGABYTES, size); } else if (numSize >= constGB && (numSize < constTB)) { size = numSize / floatGB; textSize = String.format(Locale.getDefault(), SIZE_GIGABYTES, size); } else if (numSize >= constTB) { size = numSize / floatTB; textSize = String.format(Locale.getDefault(), SIZE_TERABYTES, size); } return textSize; }
java
public static String getLocalizedFileSize(final Context context, double numSize) { String localeLanguage = Locale.getDefault().getLanguage(); if (!SIZE_LANGUAGE.equals(localeLanguage) && context != null && context.getResources() != null) { Resources resources = context.getResources(); SIZE_BYTES = resources.getString(R.string.boxsdk_bytes); SIZE_KILOBYTES = resources.getString(R.string.boxsdk_kilobytes); SIZE_MEGABYTES = resources.getString(R.string.boxsdk_megabytes); SIZE_GIGABYTES = resources.getString(R.string.boxsdk_gigabytes); SIZE_TERABYTES = resources.getString(R.string.boxsdk_terabytes); SIZE_LANGUAGE = localeLanguage; } String textSize = null; double size; if (numSize < constKB) { textSize = String.format(Locale.getDefault(), SIZE_BYTES, numSize); } else if ((numSize >= constKB) && (numSize < constMB)) { size = numSize / floatKB; textSize = String.format(Locale.getDefault(), SIZE_KILOBYTES, size); } else if ((numSize >= constMB) && (numSize < constGB)) { size = numSize / floatMB; textSize = String.format(Locale.getDefault(), SIZE_MEGABYTES, size); } else if (numSize >= constGB && (numSize < constTB)) { size = numSize / floatGB; textSize = String.format(Locale.getDefault(), SIZE_GIGABYTES, size); } else if (numSize >= constTB) { size = numSize / floatTB; textSize = String.format(Locale.getDefault(), SIZE_TERABYTES, size); } return textSize; }
[ "public", "static", "String", "getLocalizedFileSize", "(", "final", "Context", "context", ",", "double", "numSize", ")", "{", "String", "localeLanguage", "=", "Locale", ".", "getDefault", "(", ")", ".", "getLanguage", "(", ")", ";", "if", "(", "!", "SIZE_LAN...
Java version of routine to turn a long into a short user readable string. This routine is used if the JNI native C version is not available. @param numSize the number of bytes in the file. @return String Short human readable String e.g. 2.5 MB
[ "Java", "version", "of", "routine", "to", "turn", "a", "long", "into", "a", "short", "user", "readable", "string", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L739-L771
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCollectionUpdate.java
BoxRequestCollectionUpdate.setCollectionId
protected R setCollectionId(String id) { JsonArray jsonArray = new JsonArray(); if (!TextUtils.isEmpty(id)) { BoxCollection col = BoxCollection.createFromId(id); jsonArray.add(col.toJsonObject()); } mBodyMap.put(FIELD_COLLECTIONS, jsonArray); return (R) this; }
java
protected R setCollectionId(String id) { JsonArray jsonArray = new JsonArray(); if (!TextUtils.isEmpty(id)) { BoxCollection col = BoxCollection.createFromId(id); jsonArray.add(col.toJsonObject()); } mBodyMap.put(FIELD_COLLECTIONS, jsonArray); return (R) this; }
[ "protected", "R", "setCollectionId", "(", "String", "id", ")", "{", "JsonArray", "jsonArray", "=", "new", "JsonArray", "(", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "id", ")", ")", "{", "BoxCollection", "col", "=", "BoxCollection", "."...
Sets the id of the collection to update. @param id id of the collection to update. @return request with the updated collection id.
[ "Sets", "the", "id", "of", "the", "collection", "to", "update", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCollectionUpdate.java#L45-L53
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getInfoRequest
public BoxRequestsFolder.GetFolderInfo getInfoRequest(String id) { BoxRequestsFolder.GetFolderInfo request = new BoxRequestsFolder.GetFolderInfo(id, getFolderInfoUrl(id), mSession); return request; }
java
public BoxRequestsFolder.GetFolderInfo getInfoRequest(String id) { BoxRequestsFolder.GetFolderInfo request = new BoxRequestsFolder.GetFolderInfo(id, getFolderInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "GetFolderInfo", "getInfoRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "GetFolderInfo", "request", "=", "new", "BoxRequestsFolder", ".", "GetFolderInfo", "(", "id", ",", "getFolderInfoUrl", "(", "id", ")", "...
Gets a request that retrieves information on a folder @param id id of folder to retrieve info on @return request to get a folders information
[ "Gets", "a", "request", "that", "retrieves", "information", "on", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L82-L85
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getItemsRequest
public BoxRequestsFolder.GetFolderItems getItemsRequest(String id) { BoxRequestsFolder.GetFolderItems request = new BoxRequestsFolder.GetFolderItems(id, getFolderItemsUrl(id), mSession); return request; }
java
public BoxRequestsFolder.GetFolderItems getItemsRequest(String id) { BoxRequestsFolder.GetFolderItems request = new BoxRequestsFolder.GetFolderItems(id, getFolderItemsUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "GetFolderItems", "getItemsRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "GetFolderItems", "request", "=", "new", "BoxRequestsFolder", ".", "GetFolderItems", "(", "id", ",", "getFolderItemsUrl", "(", "id", ")"...
Gets a request that retrieves the items of a folder @param id id of folder to get children on @return request to get a folders children
[ "Gets", "a", "request", "that", "retrieves", "the", "items", "of", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L94-L97
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getCreateRequest
public BoxRequestsFolder.CreateFolder getCreateRequest(String parentId, String name) { BoxRequestsFolder.CreateFolder request = new BoxRequestsFolder.CreateFolder(parentId, name, getFoldersUrl(), mSession); return request; }
java
public BoxRequestsFolder.CreateFolder getCreateRequest(String parentId, String name) { BoxRequestsFolder.CreateFolder request = new BoxRequestsFolder.CreateFolder(parentId, name, getFoldersUrl(), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "CreateFolder", "getCreateRequest", "(", "String", "parentId", ",", "String", "name", ")", "{", "BoxRequestsFolder", ".", "CreateFolder", "request", "=", "new", "BoxRequestsFolder", ".", "CreateFolder", "(", "parentId", ",", "name...
Gets a request that creates a folder in a parent folder @param parentId id of the parent folder to create the folder in @param name name of the new folder @return request to create a folder
[ "Gets", "a", "request", "that", "creates", "a", "folder", "in", "a", "parent", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L120-L123
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getUpdateRequest
public BoxRequestsFolder.UpdateFolder getUpdateRequest(String id) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession); return request; }
java
public BoxRequestsFolder.UpdateFolder getUpdateRequest(String id) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "UpdateFolder", "getUpdateRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "UpdateFolder", "request", "=", "new", "BoxRequestsFolder", ".", "UpdateFolder", "(", "id", ",", "getFolderInfoUrl", "(", "id", ")", ",...
Gets a request that updates a folders information @param id id of folder to update information on @return request to update a folders information
[ "Gets", "a", "request", "that", "updates", "a", "folders", "information" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L132-L135
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getRenameRequest
public BoxRequestsFolder.UpdateFolder getRenameRequest(String id, String newName) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession) .setName(newName); return request; }
java
public BoxRequestsFolder.UpdateFolder getRenameRequest(String id, String newName) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession) .setName(newName); return request; }
[ "public", "BoxRequestsFolder", ".", "UpdateFolder", "getRenameRequest", "(", "String", "id", ",", "String", "newName", ")", "{", "BoxRequestsFolder", ".", "UpdateFolder", "request", "=", "new", "BoxRequestsFolder", ".", "UpdateFolder", "(", "id", ",", "getFolderInfo...
Gets a request that renames a folder @param id id of folder to rename @param newName id of folder to retrieve info on @return request to rename a folder
[ "Gets", "a", "request", "that", "renames", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L144-L148
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getMoveRequest
public BoxRequestsFolder.UpdateFolder getMoveRequest(String id, String parentId) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession) .setParentId(parentId); return request; }
java
public BoxRequestsFolder.UpdateFolder getMoveRequest(String id, String parentId) { BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession) .setParentId(parentId); return request; }
[ "public", "BoxRequestsFolder", ".", "UpdateFolder", "getMoveRequest", "(", "String", "id", ",", "String", "parentId", ")", "{", "BoxRequestsFolder", ".", "UpdateFolder", "request", "=", "new", "BoxRequestsFolder", ".", "UpdateFolder", "(", "id", ",", "getFolderInfoU...
Gets a request that moves a folder to another folder @param id id of folder to move @param parentId id of parent folder to move folder into @return request to move a folder
[ "Gets", "a", "request", "that", "moves", "a", "folder", "to", "another", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L157-L161
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getCopyRequest
public BoxRequestsFolder.CopyFolder getCopyRequest(String id, String parentId) { BoxRequestsFolder.CopyFolder request = new BoxRequestsFolder.CopyFolder(id, parentId, getFolderCopyUrl(id), mSession); return request; }
java
public BoxRequestsFolder.CopyFolder getCopyRequest(String id, String parentId) { BoxRequestsFolder.CopyFolder request = new BoxRequestsFolder.CopyFolder(id, parentId, getFolderCopyUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "CopyFolder", "getCopyRequest", "(", "String", "id", ",", "String", "parentId", ")", "{", "BoxRequestsFolder", ".", "CopyFolder", "request", "=", "new", "BoxRequestsFolder", ".", "CopyFolder", "(", "id", ",", "parentId", ",", ...
Gets a request that copies a folder @param id id of folder to copy @param parentId id of parent folder to copy folder into @return request to copy a folder
[ "Gets", "a", "request", "that", "copies", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L170-L173
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getCollaborationsRequest
public BoxRequestsFolder.GetCollaborations getCollaborationsRequest(String id) { BoxRequestsFolder.GetCollaborations request = new BoxRequestsFolder.GetCollaborations(id, getFolderCollaborationsUrl(id), mSession); return request; }
java
public BoxRequestsFolder.GetCollaborations getCollaborationsRequest(String id) { BoxRequestsFolder.GetCollaborations request = new BoxRequestsFolder.GetCollaborations(id, getFolderCollaborationsUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "GetCollaborations", "getCollaborationsRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "GetCollaborations", "request", "=", "new", "BoxRequestsFolder", ".", "GetCollaborations", "(", "id", ",", "getFolderCollaboration...
Gets a request that gets the collaborations of a folder @param id id of folder to move @return request to move a folder
[ "Gets", "a", "request", "that", "gets", "the", "collaborations", "of", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L192-L195
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getCreateSharedLinkRequest
public BoxRequestsFolder.UpdateSharedFolder getCreateSharedLinkRequest(String id) { BoxRequestsFolder.UpdateSharedFolder request = new BoxRequestsFolder.UpdateSharedFolder(id, getFolderInfoUrl(id), mSession) .setAccess(null); return request; }
java
public BoxRequestsFolder.UpdateSharedFolder getCreateSharedLinkRequest(String id) { BoxRequestsFolder.UpdateSharedFolder request = new BoxRequestsFolder.UpdateSharedFolder(id, getFolderInfoUrl(id), mSession) .setAccess(null); return request; }
[ "public", "BoxRequestsFolder", ".", "UpdateSharedFolder", "getCreateSharedLinkRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "UpdateSharedFolder", "request", "=", "new", "BoxRequestsFolder", ".", "UpdateSharedFolder", "(", "id", ",", "getFolderInfoUrl"...
Gets a request that creates a shared link for a folder @param id id of folder to create shared link for @return request to create a shared link for a folder
[ "Gets", "a", "request", "that", "creates", "a", "shared", "link", "for", "a", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L203-L207
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getAddToCollectionRequest
public BoxRequestsFolder.AddFolderToCollection getAddToCollectionRequest(String folderId, String collectionId) { BoxRequestsFolder.AddFolderToCollection request = new BoxRequestsFolder.AddFolderToCollection(folderId, collectionId, getFolderInfoUrl(folderId), mSession); return request; }
java
public BoxRequestsFolder.AddFolderToCollection getAddToCollectionRequest(String folderId, String collectionId) { BoxRequestsFolder.AddFolderToCollection request = new BoxRequestsFolder.AddFolderToCollection(folderId, collectionId, getFolderInfoUrl(folderId), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "AddFolderToCollection", "getAddToCollectionRequest", "(", "String", "folderId", ",", "String", "collectionId", ")", "{", "BoxRequestsFolder", ".", "AddFolderToCollection", "request", "=", "new", "BoxRequestsFolder", ".", "AddFolderToColl...
Gets a request that adds a folder to a collection @param folderId id of folder to add to collection @param collectionId id of collection to add the folder to @return request to add a folder to a collection
[ "Gets", "a", "request", "that", "adds", "a", "folder", "to", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L228-L231
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getDeleteFromCollectionRequest
public BoxRequestsFolder.DeleteFolderFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsFolder.DeleteFolderFromCollection request = new BoxRequestsFolder.DeleteFolderFromCollection(id, getFolderInfoUrl(id), mSession); return request; }
java
public BoxRequestsFolder.DeleteFolderFromCollection getDeleteFromCollectionRequest(String id) { BoxRequestsFolder.DeleteFolderFromCollection request = new BoxRequestsFolder.DeleteFolderFromCollection(id, getFolderInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "DeleteFolderFromCollection", "getDeleteFromCollectionRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "DeleteFolderFromCollection", "request", "=", "new", "BoxRequestsFolder", ".", "DeleteFolderFromCollection", "(", "id",...
Gets a request that removes a folder from a collection @param id id of folder to delete from the collection @return request to delete a folder from a collection
[ "Gets", "a", "request", "that", "removes", "a", "folder", "from", "a", "collection" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L239-L242
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getTrashedItemsRequest
public BoxRequestsFolder.GetTrashedItems getTrashedItemsRequest() { BoxRequestsFolder.GetTrashedItems request = new BoxRequestsFolder.GetTrashedItems(getTrashedItemsUrl(), mSession); return request; }
java
public BoxRequestsFolder.GetTrashedItems getTrashedItemsRequest() { BoxRequestsFolder.GetTrashedItems request = new BoxRequestsFolder.GetTrashedItems(getTrashedItemsUrl(), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "GetTrashedItems", "getTrashedItemsRequest", "(", ")", "{", "BoxRequestsFolder", ".", "GetTrashedItems", "request", "=", "new", "BoxRequestsFolder", ".", "GetTrashedItems", "(", "getTrashedItemsUrl", "(", ")", ",", "mSession", ")", ...
Gets a request that returns the items in the trash @return request to get a folder from the trash
[ "Gets", "a", "request", "that", "returns", "the", "items", "in", "the", "trash" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L249-L252
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getTrashedFolderRequest
public BoxRequestsFolder.GetTrashedFolder getTrashedFolderRequest(String id) { BoxRequestsFolder.GetTrashedFolder request = new BoxRequestsFolder.GetTrashedFolder(id, getTrashedFolderUrl(id), mSession); return request; }
java
public BoxRequestsFolder.GetTrashedFolder getTrashedFolderRequest(String id) { BoxRequestsFolder.GetTrashedFolder request = new BoxRequestsFolder.GetTrashedFolder(id, getTrashedFolderUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "GetTrashedFolder", "getTrashedFolderRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "GetTrashedFolder", "request", "=", "new", "BoxRequestsFolder", ".", "GetTrashedFolder", "(", "id", ",", "getTrashedFolderUrl", "(...
Gets a request that returns a folder in the trash @param id id of folder to get in the trash @return request to get a folder from the trash
[ "Gets", "a", "request", "that", "returns", "a", "folder", "in", "the", "trash" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L260-L263
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getDeleteTrashedFolderRequest
public BoxRequestsFolder.DeleteTrashedFolder getDeleteTrashedFolderRequest(String id) { BoxRequestsFolder.DeleteTrashedFolder request = new BoxRequestsFolder.DeleteTrashedFolder(id, getTrashedFolderUrl(id), mSession); return request; }
java
public BoxRequestsFolder.DeleteTrashedFolder getDeleteTrashedFolderRequest(String id) { BoxRequestsFolder.DeleteTrashedFolder request = new BoxRequestsFolder.DeleteTrashedFolder(id, getTrashedFolderUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "DeleteTrashedFolder", "getDeleteTrashedFolderRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "DeleteTrashedFolder", "request", "=", "new", "BoxRequestsFolder", ".", "DeleteTrashedFolder", "(", "id", ",", "getTrashedF...
Gets a request that permanently deletes a folder from the trash @param id id of folder to delete from the trash @return request to permanently delete a folder from the trash
[ "Gets", "a", "request", "that", "permanently", "deletes", "a", "folder", "from", "the", "trash" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L271-L274
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java
BoxApiFolder.getRestoreTrashedFolderRequest
public BoxRequestsFolder.RestoreTrashedFolder getRestoreTrashedFolderRequest(String id) { BoxRequestsFolder.RestoreTrashedFolder request = new BoxRequestsFolder.RestoreTrashedFolder(id, getFolderInfoUrl(id), mSession); return request; }
java
public BoxRequestsFolder.RestoreTrashedFolder getRestoreTrashedFolderRequest(String id) { BoxRequestsFolder.RestoreTrashedFolder request = new BoxRequestsFolder.RestoreTrashedFolder(id, getFolderInfoUrl(id), mSession); return request; }
[ "public", "BoxRequestsFolder", ".", "RestoreTrashedFolder", "getRestoreTrashedFolderRequest", "(", "String", "id", ")", "{", "BoxRequestsFolder", ".", "RestoreTrashedFolder", "request", "=", "new", "BoxRequestsFolder", ".", "RestoreTrashedFolder", "(", "id", ",", "getFold...
Gets a request that restores a trashed folder @param id id of folder to restore @return request to restore a folder from the trash
[ "Gets", "a", "request", "that", "restores", "a", "trashed", "folder" ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L282-L285
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getInfoRequest
public BoxRequestsShare.GetCollaborationInfo getInfoRequest(String collaborationId) { BoxRequestsShare.GetCollaborationInfo collab = new BoxRequestsShare.GetCollaborationInfo(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
java
public BoxRequestsShare.GetCollaborationInfo getInfoRequest(String collaborationId) { BoxRequestsShare.GetCollaborationInfo collab = new BoxRequestsShare.GetCollaborationInfo(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
[ "public", "BoxRequestsShare", ".", "GetCollaborationInfo", "getInfoRequest", "(", "String", "collaborationId", ")", "{", "BoxRequestsShare", ".", "GetCollaborationInfo", "collab", "=", "new", "BoxRequestsShare", ".", "GetCollaborationInfo", "(", "collaborationId", ",", "g...
A request to retrieve a collaboration of a given id. @param collaborationId id of the collaboration to retrieve @return request to retrieve information about a collaboration
[ "A", "request", "to", "retrieve", "a", "collaboration", "of", "a", "given", "id", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L49-L52
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getAddRequest
public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login) { BoxRequestsShare.AddCollaboration collab = new BoxRequestsShare.AddCollaboration(getCollaborationsUrl(), createStubItem(collaborationItem), role, login, mSession); return collab; }
java
public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login) { BoxRequestsShare.AddCollaboration collab = new BoxRequestsShare.AddCollaboration(getCollaborationsUrl(), createStubItem(collaborationItem), role, login, mSession); return collab; }
[ "public", "BoxRequestsShare", ".", "AddCollaboration", "getAddRequest", "(", "BoxCollaborationItem", "collaborationItem", ",", "BoxCollaboration", ".", "Role", "role", ",", "String", "login", ")", "{", "BoxRequestsShare", ".", "AddCollaboration", "collab", "=", "new", ...
A request that adds a user as a collaborator to an item by using their login. @param collaborationItem item to be collaborated. @param role role of the collaboration @param login email address of the user to add @return request to add/create a collaboration
[ "A", "request", "that", "adds", "a", "user", "as", "a", "collaborator", "to", "an", "item", "by", "using", "their", "login", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L168-L172
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getPendingCollaborationsRequest
public BoxRequestsShare.GetPendingCollaborations getPendingCollaborationsRequest() { BoxRequestsShare.GetPendingCollaborations request = new BoxRequestsShare.GetPendingCollaborations(getCollaborationsUrl(), mSession); return request; }
java
public BoxRequestsShare.GetPendingCollaborations getPendingCollaborationsRequest() { BoxRequestsShare.GetPendingCollaborations request = new BoxRequestsShare.GetPendingCollaborations(getCollaborationsUrl(), mSession); return request; }
[ "public", "BoxRequestsShare", ".", "GetPendingCollaborations", "getPendingCollaborationsRequest", "(", ")", "{", "BoxRequestsShare", ".", "GetPendingCollaborations", "request", "=", "new", "BoxRequestsShare", ".", "GetPendingCollaborations", "(", "getCollaborationsUrl", "(", ...
A request to retrieve a list of pending collaborations for the user. @return request to retrieve pending collaborations.
[ "A", "request", "to", "retrieve", "a", "list", "of", "pending", "collaborations", "for", "the", "user", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L179-L182
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getDeleteRequest
public BoxRequestsShare.DeleteCollaboration getDeleteRequest(String collaborationId) { BoxRequestsShare.DeleteCollaboration collab = new BoxRequestsShare.DeleteCollaboration(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
java
public BoxRequestsShare.DeleteCollaboration getDeleteRequest(String collaborationId) { BoxRequestsShare.DeleteCollaboration collab = new BoxRequestsShare.DeleteCollaboration(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
[ "public", "BoxRequestsShare", ".", "DeleteCollaboration", "getDeleteRequest", "(", "String", "collaborationId", ")", "{", "BoxRequestsShare", ".", "DeleteCollaboration", "collab", "=", "new", "BoxRequestsShare", ".", "DeleteCollaboration", "(", "collaborationId", ",", "ge...
A request to delete a collaboration with given collaboration id. @param collaborationId id of the collaboration to delete @return request to delete a collaboration
[ "A", "request", "to", "delete", "a", "collaboration", "with", "given", "collaboration", "id", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L190-L193
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java
BoxApiCollaboration.getUpdateOwnerRequest
public BoxRequestsShare.UpdateOwner getUpdateOwnerRequest(String collaborationId) { BoxRequestsShare.UpdateOwner collab = new BoxRequestsShare.UpdateOwner(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
java
public BoxRequestsShare.UpdateOwner getUpdateOwnerRequest(String collaborationId) { BoxRequestsShare.UpdateOwner collab = new BoxRequestsShare.UpdateOwner(collaborationId, getCollaborationInfoUrl(collaborationId), mSession); return collab; }
[ "public", "BoxRequestsShare", ".", "UpdateOwner", "getUpdateOwnerRequest", "(", "String", "collaborationId", ")", "{", "BoxRequestsShare", ".", "UpdateOwner", "collab", "=", "new", "BoxRequestsShare", ".", "UpdateOwner", "(", "collaborationId", ",", "getCollaborationInfoU...
A request to change role to owner given a collaboration id. @param collaborationId id of the collaboration to update @return request to update role to owner for a collaboration
[ "A", "request", "to", "change", "role", "to", "owner", "given", "a", "collaboration", "id", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L214-L217
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/BoxDateFormat.java
BoxDateFormat.format
public static String format(Date date) { String format = LOCAL_DATE_FORMAT.format(date); // Java 6 does not have a convenient way of having the colon in the timezone offset return format.substring(0,22) + ":" + format.substring(22); }
java
public static String format(Date date) { String format = LOCAL_DATE_FORMAT.format(date); // Java 6 does not have a convenient way of having the colon in the timezone offset return format.substring(0,22) + ":" + format.substring(22); }
[ "public", "static", "String", "format", "(", "Date", "date", ")", "{", "String", "format", "=", "LOCAL_DATE_FORMAT", ".", "format", "(", "date", ")", ";", "// Java 6 does not have a convenient way of having the colon in the timezone offset", "return", "format", ".", "su...
Formats a date as a string that can be sent to the Box API. @param date the date to format. @return a string containing the formatted date.
[ "Formats", "a", "date", "as", "a", "string", "that", "can", "be", "sent", "to", "the", "Box", "API", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/BoxDateFormat.java#L89-L93
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/BoxDateFormat.java
BoxDateFormat.getTimeRangeString
public static String getTimeRangeString(Date fromDate, Date toDate) { if (fromDate == null && toDate == null) { return null; } StringBuilder sbr = new StringBuilder(); if (fromDate != null) { sbr.append(format(fromDate)); } sbr.append(","); if (toDate != null) { sbr.append(format(toDate)); } return sbr.toString(); }
java
public static String getTimeRangeString(Date fromDate, Date toDate) { if (fromDate == null && toDate == null) { return null; } StringBuilder sbr = new StringBuilder(); if (fromDate != null) { sbr.append(format(fromDate)); } sbr.append(","); if (toDate != null) { sbr.append(format(toDate)); } return sbr.toString(); }
[ "public", "static", "String", "getTimeRangeString", "(", "Date", "fromDate", ",", "Date", "toDate", ")", "{", "if", "(", "fromDate", "==", "null", "&&", "toDate", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "sbr", "=", "new", "St...
Get a String to represent a time range. @param fromDate can use null if don't want to specify this. @param toDate can use null if don't want to specify this. @return The string will be time strings separated by a comma. Trailing "from_date," and leading ",to_date" are also accepted if one of the date is null. Returns null if both dates are null.
[ "Get", "a", "String", "to", "represent", "a", "time", "range", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/BoxDateFormat.java#L114-L128
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxException.java
BoxException.getAsBoxError
public BoxError getAsBoxError() { try { BoxError error = new BoxError(); error.createFromJson(getResponse()); return error; } catch (Exception e) { return null; } }
java
public BoxError getAsBoxError() { try { BoxError error = new BoxError(); error.createFromJson(getResponse()); return error; } catch (Exception e) { return null; } }
[ "public", "BoxError", "getAsBoxError", "(", ")", "{", "try", "{", "BoxError", "error", "=", "new", "BoxError", "(", ")", ";", "error", ".", "createFromJson", "(", "getResponse", "(", ")", ")", ";", "return", "error", ";", "}", "catch", "(", "Exception", ...
Gets the server response as a BoxError. @return the response as a BoxError, or null if the response cannot be converted.
[ "Gets", "the", "server", "response", "as", "a", "BoxError", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxException.java#L114-L122
train
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemUpdate.java
BoxRequestItemUpdate.getDescription
public String getDescription() { return mBodyMap.containsKey(BoxItem.FIELD_DESCRIPTION) ? (String) mBodyMap.get(BoxItem.FIELD_DESCRIPTION) : null; }
java
public String getDescription() { return mBodyMap.containsKey(BoxItem.FIELD_DESCRIPTION) ? (String) mBodyMap.get(BoxItem.FIELD_DESCRIPTION) : null; }
[ "public", "String", "getDescription", "(", ")", "{", "return", "mBodyMap", ".", "containsKey", "(", "BoxItem", ".", "FIELD_DESCRIPTION", ")", "?", "(", "String", ")", "mBodyMap", ".", "get", "(", "BoxItem", ".", "FIELD_DESCRIPTION", ")", ":", "null", ";", ...
Returns the new description currently set for the item. @return description for the item, or null if not set.
[ "Returns", "the", "new", "description", "currently", "set", "for", "the", "item", "." ]
a621ad5ddebf23067fec27529130d72718fc0e88
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemUpdate.java#L72-L76
train