id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
163,600 | box/box-java-sdk | src/main/java/com/box/sdk/BoxJSONObject.java | BoxJSONObject.getPendingJSONObject | private JsonObject getPendingJSONObject() {
for (Map.Entry<String, BoxJSONObject> entry : this.children.entrySet()) {
BoxJSONObject child = entry.getValue();
JsonObject jsonObject = child.getPendingJSONObject();
if (jsonObject != null) {
if (this.pendingChange... | java | private JsonObject getPendingJSONObject() {
for (Map.Entry<String, BoxJSONObject> entry : this.children.entrySet()) {
BoxJSONObject child = entry.getValue();
JsonObject jsonObject = child.getPendingJSONObject();
if (jsonObject != null) {
if (this.pendingChange... | [
"private",
"JsonObject",
"getPendingJSONObject",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"BoxJSONObject",
">",
"entry",
":",
"this",
".",
"children",
".",
"entrySet",
"(",
")",
")",
"{",
"BoxJSONObject",
"child",
"=",
"entry",
... | Gets a JsonObject containing any pending changes to this object that can be sent back to the Box API.
@return a JsonObject containing the pending changes. | [
"Gets",
"a",
"JsonObject",
"containing",
"any",
"pending",
"changes",
"to",
"this",
"object",
"that",
"can",
"be",
"sent",
"back",
"to",
"the",
"Box",
"API",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L203-L216 |
163,601 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.addHeader | public void addHeader(String key, String value) {
if (key.equals("As-User")) {
for (int i = 0; i < this.headers.size(); i++) {
if (this.headers.get(i).getKey().equals("As-User")) {
this.headers.remove(i);
}
}
}
if (key.e... | java | public void addHeader(String key, String value) {
if (key.equals("As-User")) {
for (int i = 0; i < this.headers.size(); i++) {
if (this.headers.get(i).getKey().equals("As-User")) {
this.headers.remove(i);
}
}
}
if (key.e... | [
"public",
"void",
"addHeader",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
".",
"equals",
"(",
"\"As-User\"",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"headers",
".",
"size",
"(",
... | Adds an HTTP header to this request.
@param key the header key.
@param value the header value. | [
"Adds",
"an",
"HTTP",
"header",
"to",
"this",
"request",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L178-L190 |
163,602 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.setBody | public void setBody(String body) {
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
this.bodyLength = bytes.length;
this.body = new ByteArrayInputStream(bytes);
} | java | public void setBody(String body) {
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
this.bodyLength = bytes.length;
this.body = new ByteArrayInputStream(bytes);
} | [
"public",
"void",
"setBody",
"(",
"String",
"body",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"body",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"this",
".",
"bodyLength",
"=",
"bytes",
".",
"length",
";",
"this",
".",
"body",
... | Sets the request body to the contents of a String.
<p>If the contents of the body are large, then it may be more efficient to use an {@link InputStream} instead of
a String. Using a String requires that the entire body be in memory before sending the request.</p>
@param body a String containing the contents of the bo... | [
"Sets",
"the",
"request",
"body",
"to",
"the",
"contents",
"of",
"a",
"String",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L280-L284 |
163,603 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.send | public BoxAPIResponse send(ProgressListener listener) {
if (this.api == null) {
this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts());
} else {
this.backoffCounter.reset(this.api.getMaxRequestAttempts());
}
while (this.backoffCounter.getAttemptsRem... | java | public BoxAPIResponse send(ProgressListener listener) {
if (this.api == null) {
this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts());
} else {
this.backoffCounter.reset(this.api.getMaxRequestAttempts());
}
while (this.backoffCounter.getAttemptsRem... | [
"public",
"BoxAPIResponse",
"send",
"(",
"ProgressListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"api",
"==",
"null",
")",
"{",
"this",
".",
"backoffCounter",
".",
"reset",
"(",
"BoxGlobalSettings",
".",
"getMaxRequestAttempts",
"(",
")",
")",
";",... | Sends this request while monitoring its progress and returns a BoxAPIResponse containing the server's response.
<p>A ProgressListener is generally only useful when the size of the request is known beforehand. If the size is
unknown, then the ProgressListener will be updated for each byte sent, but the total number of ... | [
"Sends",
"this",
"request",
"while",
"monitoring",
"its",
"progress",
"and",
"returns",
"a",
"BoxAPIResponse",
"containing",
"the",
"server",
"s",
"response",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L345-L376 |
163,604 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIRequest.java | BoxAPIRequest.writeBody | protected void writeBody(HttpURLConnection connection, ProgressListener listener) {
if (this.body == null) {
return;
}
connection.setDoOutput(true);
try {
OutputStream output = connection.getOutputStream();
if (listener != null) {
outp... | java | protected void writeBody(HttpURLConnection connection, ProgressListener listener) {
if (this.body == null) {
return;
}
connection.setDoOutput(true);
try {
OutputStream output = connection.getOutputStream();
if (listener != null) {
outp... | [
"protected",
"void",
"writeBody",
"(",
"HttpURLConnection",
"connection",
",",
"ProgressListener",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"body",
"==",
"null",
")",
"{",
"return",
";",
"}",
"connection",
".",
"setDoOutput",
"(",
"true",
")",
";",
"t... | Writes the body of this request to an HttpURLConnection.
<p>Subclasses overriding this method must remember to close the connection's OutputStream after writing.</p>
@param connection the connection to which the body should be written.
@param listener an optional listener for monitoring the write progress.
@throws ... | [
"Writes",
"the",
"body",
"of",
"this",
"request",
"to",
"an",
"HttpURLConnection",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIRequest.java#L450-L470 |
163,605 | box/box-java-sdk | src/main/java/com/box/sdk/BoxLegalHoldPolicy.java | BoxLegalHoldPolicy.createOngoing | public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description) {
URL url = ALL_LEGAL_HOLD_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject requestJSON = new JsonObject()
.ad... | java | public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description) {
URL url = ALL_LEGAL_HOLD_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject requestJSON = new JsonObject()
.ad... | [
"public",
"static",
"BoxLegalHoldPolicy",
".",
"Info",
"createOngoing",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"String",
"description",
")",
"{",
"URL",
"url",
"=",
"ALL_LEGAL_HOLD_URL_TEMPLATE",
".",
"build",
"(",
"api",
".",
"getBaseURL",
... | Creates a new ongoing Legal Hold Policy.
@param api the API connection to be used by the resource.
@param name the name of Legal Hold Policy.
@param description the description of Legal Hold Policy.
@return information about the Legal Hold Policy created. | [
"Creates",
"a",
"new",
"ongoing",
"Legal",
"Hold",
"Policy",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L116-L130 |
163,606 | box/box-java-sdk | src/main/java/com/box/sdk/BoxLegalHoldPolicy.java | BoxLegalHoldPolicy.getAssignments | public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) {
return this.getAssignments(null, null, DEFAULT_LIMIT, fields);
} | java | public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String ... fields) {
return this.getAssignments(null, null, DEFAULT_LIMIT, fields);
} | [
"public",
"Iterable",
"<",
"BoxLegalHoldAssignment",
".",
"Info",
">",
"getAssignments",
"(",
"String",
"...",
"fields",
")",
"{",
"return",
"this",
".",
"getAssignments",
"(",
"null",
",",
"null",
",",
"DEFAULT_LIMIT",
",",
"fields",
")",
";",
"}"
] | Returns iterable containing assignments for this single legal hold policy.
@param fields the fields to retrieve.
@return an iterable containing assignments for this single legal hold policy. | [
"Returns",
"iterable",
"containing",
"assignments",
"for",
"this",
"single",
"legal",
"hold",
"policy",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L210-L212 |
163,607 | box/box-java-sdk | src/main/java/com/box/sdk/BoxLegalHoldPolicy.java | BoxLegalHoldPolicy.getAssignments | public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String type, String id, int limit, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (type != null) {
builder.appendParam("assign_to_type", type);
}
if (id != null) {
builder.... | java | public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String type, String id, int limit, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (type != null) {
builder.appendParam("assign_to_type", type);
}
if (id != null) {
builder.... | [
"public",
"Iterable",
"<",
"BoxLegalHoldAssignment",
".",
"Info",
">",
"getAssignments",
"(",
"String",
"type",
",",
"String",
"id",
",",
"int",
"limit",
",",
"String",
"...",
"fields",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",... | Returns iterable containing assignments for this single legal hold policy.
Parameters can be used to filter retrieved assignments.
@param type filter assignments of this type only.
Can be "file_version", "file", "folder", "user" or null if no type filter is necessary.
@param id filter assignments to this ID only. Can b... | [
"Returns",
"iterable",
"containing",
"assignments",
"for",
"this",
"single",
"legal",
"hold",
"policy",
".",
"Parameters",
"can",
"be",
"used",
"to",
"filter",
"retrieved",
"assignments",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L224-L246 |
163,608 | box/box-java-sdk | src/main/java/com/box/sdk/BoxLegalHoldPolicy.java | BoxLegalHoldPolicy.getFileVersionHolds | public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(int limit, String ... fields) {
QueryStringBuilder queryString = new QueryStringBuilder().appendParam("policy_id", this.getID());
if (fields.length > 0) {
queryString.appendParam("fields", fields);
}
URL url = ... | java | public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(int limit, String ... fields) {
QueryStringBuilder queryString = new QueryStringBuilder().appendParam("policy_id", this.getID());
if (fields.length > 0) {
queryString.appendParam("fields", fields);
}
URL url = ... | [
"public",
"Iterable",
"<",
"BoxFileVersionLegalHold",
".",
"Info",
">",
"getFileVersionHolds",
"(",
"int",
"limit",
",",
"String",
"...",
"fields",
")",
"{",
"QueryStringBuilder",
"queryString",
"=",
"new",
"QueryStringBuilder",
"(",
")",
".",
"appendParam",
"(",
... | Returns iterable with all non-deleted file version legal holds for this legal hold policy.
@param limit the limit of entries per response. The default value is 100.
@param fields the fields to retrieve.
@return an iterable containing file version legal holds info. | [
"Returns",
"iterable",
"with",
"all",
"non",
"-",
"deleted",
"file",
"version",
"legal",
"holds",
"for",
"this",
"legal",
"hold",
"policy",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxLegalHoldPolicy.java#L263-L279 |
163,609 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersionRetention.java | BoxFileVersionRetention.getAll | public static Iterable<BoxFileVersionRetention.Info> getAll(BoxAPIConnection api, String ... fields) {
return getRetentions(api, new QueryFilter(), fields);
} | java | public static Iterable<BoxFileVersionRetention.Info> getAll(BoxAPIConnection api, String ... fields) {
return getRetentions(api, new QueryFilter(), fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxFileVersionRetention",
".",
"Info",
">",
"getAll",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"...",
"fields",
")",
"{",
"return",
"getRetentions",
"(",
"api",
",",
"new",
"QueryFilter",
"(",
")",
",",
"fields",
"... | Retrieves all file version retentions.
@param api the API connection to be used by the resource.
@param fields the fields to retrieve.
@return an iterable contains information about all file version retentions. | [
"Retrieves",
"all",
"file",
"version",
"retentions",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L72-L74 |
163,610 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersionRetention.java | BoxFileVersionRetention.getRetentions | public static Iterable<BoxFileVersionRetention.Info> getRetentions(
final BoxAPIConnection api, QueryFilter filter, String ... fields) {
filter.addFields(fields);
return new BoxResourceIterable<BoxFileVersionRetention.Info>(api,
ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api.... | java | public static Iterable<BoxFileVersionRetention.Info> getRetentions(
final BoxAPIConnection api, QueryFilter filter, String ... fields) {
filter.addFields(fields);
return new BoxResourceIterable<BoxFileVersionRetention.Info>(api,
ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api.... | [
"public",
"static",
"Iterable",
"<",
"BoxFileVersionRetention",
".",
"Info",
">",
"getRetentions",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"QueryFilter",
"filter",
",",
"String",
"...",
"fields",
")",
"{",
"filter",
".",
"addFields",
"(",
"fields",
")",
... | Retrieves all file version retentions matching given filters as an Iterable.
@param api the API connection to be used by the resource.
@param filter filters for the query stored in QueryFilter object.
@param fields the fields to retrieve.
@return an iterable contains information about all file version retentions matchi... | [
"Retrieves",
"all",
"file",
"version",
"retentions",
"matching",
"given",
"filters",
"as",
"an",
"Iterable",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L83-L96 |
163,611 | box/box-java-sdk | src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java | BoxWebHookSignatureVerifier.verify | public boolean verify(String signatureVersion, String signatureAlgorithm, String primarySignature,
String secondarySignature, String webHookPayload, String deliveryTimestamp) {
// enforce versions supported by this implementation
if (!SUPPORTED_VERSIONS.contains(signatureVersion)) {
... | java | public boolean verify(String signatureVersion, String signatureAlgorithm, String primarySignature,
String secondarySignature, String webHookPayload, String deliveryTimestamp) {
// enforce versions supported by this implementation
if (!SUPPORTED_VERSIONS.contains(signatureVersion)) {
... | [
"public",
"boolean",
"verify",
"(",
"String",
"signatureVersion",
",",
"String",
"signatureAlgorithm",
",",
"String",
"primarySignature",
",",
"String",
"secondarySignature",
",",
"String",
"webHookPayload",
",",
"String",
"deliveryTimestamp",
")",
"{",
"// enforce vers... | Verifies given web-hook information.
@param signatureVersion
signature version received from web-hook
@param signatureAlgorithm
signature algorithm received from web-hook
@param primarySignature
primary signature received from web-hook
@param secondarySignature
secondary signature received from web-hook
@param webHook... | [
"Verifies",
"given",
"web",
"-",
"hook",
"information",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java#L93-L121 |
163,612 | box/box-java-sdk | src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java | BoxWebHookSignatureVerifier.verify | private boolean verify(String key, BoxSignatureAlgorithm actualAlgorithm, String actualSignature,
String webHookPayload, String deliveryTimestamp) {
if (actualSignature == null) {
return false;
}
byte[] actual = Base64.decode(actualSignature);
byte[] expected = t... | java | private boolean verify(String key, BoxSignatureAlgorithm actualAlgorithm, String actualSignature,
String webHookPayload, String deliveryTimestamp) {
if (actualSignature == null) {
return false;
}
byte[] actual = Base64.decode(actualSignature);
byte[] expected = t... | [
"private",
"boolean",
"verify",
"(",
"String",
"key",
",",
"BoxSignatureAlgorithm",
"actualAlgorithm",
",",
"String",
"actualSignature",
",",
"String",
"webHookPayload",
",",
"String",
"deliveryTimestamp",
")",
"{",
"if",
"(",
"actualSignature",
"==",
"null",
")",
... | Verifies a provided signature.
@param key
for which signature key
@param actualAlgorithm
current signature algorithm
@param actualSignature
current signature
@param webHookPayload
for signing
@param deliveryTimestamp
for signing
@return true if verification passed | [
"Verifies",
"a",
"provided",
"signature",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java#L138-L148 |
163,613 | box/box-java-sdk | src/main/java/com/box/sdk/BoxSearch.java | BoxSearch.searchRange | public PartialCollection<BoxItem.Info> searchRange(long offset, long limit, final BoxSearchParameters bsp) {
QueryStringBuilder builder = bsp.getQueryParameters()
.appendParam("limit", limit)
.appendParam("offset", offset);
URL url = SEARCH_URL_TEMPLATE.buildWithQuery(thi... | java | public PartialCollection<BoxItem.Info> searchRange(long offset, long limit, final BoxSearchParameters bsp) {
QueryStringBuilder builder = bsp.getQueryParameters()
.appendParam("limit", limit)
.appendParam("offset", offset);
URL url = SEARCH_URL_TEMPLATE.buildWithQuery(thi... | [
"public",
"PartialCollection",
"<",
"BoxItem",
".",
"Info",
">",
"searchRange",
"(",
"long",
"offset",
",",
"long",
"limit",
",",
"final",
"BoxSearchParameters",
"bsp",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"bsp",
".",
"getQueryParameters",
"(",
")",
... | Searches all descendant folders using a given query and query parameters.
@param offset is the starting position.
@param limit the maximum number of items to return. The default is 30 and the maximum is 200.
@param bsp containing query and advanced search capabilities.
@return a PartialCollection containing the sear... | [
"Searches",
"all",
"descendant",
"folders",
"using",
"a",
"given",
"query",
"and",
"query",
"parameters",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxSearch.java#L38-L58 |
163,614 | box/box-java-sdk | src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java | BoxTransactionalAPIConnection.getTransactionConnection | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {
return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null);
} | java | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {
return BoxTransactionalAPIConnection.getTransactionConnection(accessToken, scope, null);
} | [
"public",
"static",
"BoxAPIConnection",
"getTransactionConnection",
"(",
"String",
"accessToken",
",",
"String",
"scope",
")",
"{",
"return",
"BoxTransactionalAPIConnection",
".",
"getTransactionConnection",
"(",
"accessToken",
",",
"scope",
",",
"null",
")",
";",
"}"... | Request a scoped transactional token.
@param accessToken application access token.
@param scope scope of transactional token.
@return a BoxAPIConnection which can be used to perform transactional requests. | [
"Request",
"a",
"scoped",
"transactional",
"token",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L35-L37 |
163,615 | box/box-java-sdk | src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java | BoxTransactionalAPIConnection.getTransactionConnection | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) {
BoxAPIConnection apiConnection = new BoxAPIConnection(accessToken);
URL url;
try {
url = new URL(apiConnection.getTokenURL());
} catch (MalformedURLException e) {
... | java | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) {
BoxAPIConnection apiConnection = new BoxAPIConnection(accessToken);
URL url;
try {
url = new URL(apiConnection.getTokenURL());
} catch (MalformedURLException e) {
... | [
"public",
"static",
"BoxAPIConnection",
"getTransactionConnection",
"(",
"String",
"accessToken",
",",
"String",
"scope",
",",
"String",
"resource",
")",
"{",
"BoxAPIConnection",
"apiConnection",
"=",
"new",
"BoxAPIConnection",
"(",
"accessToken",
")",
";",
"URL",
"... | Request a scoped transactional token for a particular resource.
@param accessToken application access token.
@param scope scope of transactional token.
@param resource resource transactional token has access to.
@return a BoxAPIConnection which can be used to perform transactional requests. | [
"Request",
"a",
"scoped",
"transactional",
"token",
"for",
"a",
"particular",
"resource",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L46-L83 |
163,616 | box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getSharedItem | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink) {
return getSharedItem(api, sharedLink, null);
} | java | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink) {
return getSharedItem(api, sharedLink, null);
} | [
"public",
"static",
"BoxItem",
".",
"Info",
"getSharedItem",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"sharedLink",
")",
"{",
"return",
"getSharedItem",
"(",
"api",
",",
"sharedLink",
",",
"null",
")",
";",
"}"
] | Gets an item that was shared with a shared link.
@param api the API connection to be used by the shared item.
@param sharedLink the shared link to the item.
@return info about the shared item. | [
"Gets",
"an",
"item",
"that",
"was",
"shared",
"with",
"a",
"shared",
"link",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L60-L62 |
163,617 | box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getSharedItem | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) {
BoxAPIConnection newAPI = new SharedLinkAPIConnection(api, sharedLink, password);
URL url = SHARED_ITEM_URL_TEMPLATE.build(newAPI.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(newAPI, ... | java | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) {
BoxAPIConnection newAPI = new SharedLinkAPIConnection(api, sharedLink, password);
URL url = SHARED_ITEM_URL_TEMPLATE.build(newAPI.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(newAPI, ... | [
"public",
"static",
"BoxItem",
".",
"Info",
"getSharedItem",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"sharedLink",
",",
"String",
"password",
")",
"{",
"BoxAPIConnection",
"newAPI",
"=",
"new",
"SharedLinkAPIConnection",
"(",
"api",
",",
"sharedLink",
",",
... | Gets an item that was shared with a password-protected shared link.
@param api the API connection to be used by the shared item.
@param sharedLink the shared link to the item.
@param password the password for the shared link.
@return info about the shared item. | [
"Gets",
"an",
"item",
"that",
"was",
"shared",
"with",
"a",
"password",
"-",
"protected",
"shared",
"link",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L71-L78 |
163,618 | box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getWatermark | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... | java | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... | [
"protected",
"BoxWatermark",
"getWatermark",
"(",
"URLTemplate",
"itemUrl",
",",
"String",
"...",
"fields",
")",
"{",
"URL",
"watermarkUrl",
"=",
"itemUrl",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
... | Used to retrieve the watermark for the item.
If the item does not have a watermark applied to it, a 404 Not Found will be returned by API.
@param itemUrl url template for the item.
@param fields the fields to retrieve.
@return the watermark associated with the item. | [
"Used",
"to",
"retrieve",
"the",
"watermark",
"for",
"the",
"item",
".",
"If",
"the",
"item",
"does",
"not",
"have",
"a",
"watermark",
"applied",
"to",
"it",
"a",
"404",
"Not",
"Found",
"will",
"be",
"returned",
"by",
"API",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L87-L97 |
163,619 | box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.applyWatermark | protected BoxWatermark applyWatermark(URLTemplate itemUrl, String imprint) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
... | java | protected BoxWatermark applyWatermark(URLTemplate itemUrl, String imprint) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
... | [
"protected",
"BoxWatermark",
"applyWatermark",
"(",
"URLTemplate",
"itemUrl",
",",
"String",
"imprint",
")",
"{",
"URL",
"watermarkUrl",
"=",
"itemUrl",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"get... | Used to apply or update the watermark for the item.
@param itemUrl url template for the item.
@param imprint the value must be "default", as custom watermarks is not yet supported.
@return the watermark associated with the item. | [
"Used",
"to",
"apply",
"or",
"update",
"the",
"watermark",
"for",
"the",
"item",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L105-L115 |
163,620 | box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.removeWatermark | protected void removeWatermark(URLTemplate itemUrl) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse respo... | java | protected void removeWatermark(URLTemplate itemUrl) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
URL url = WATERMARK_URL_TEMPLATE.build(watermarkUrl.toString());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse respo... | [
"protected",
"void",
"removeWatermark",
"(",
"URLTemplate",
"itemUrl",
")",
"{",
"URL",
"watermarkUrl",
"=",
"itemUrl",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
")",
";",
"URL... | Removes a watermark from the item.
If the item did not have a watermark applied to it, a 404 Not Found will be returned by API.
@param itemUrl url template for the item. | [
"Removes",
"a",
"watermark",
"from",
"the",
"item",
".",
"If",
"the",
"item",
"did",
"not",
"have",
"a",
"watermark",
"applied",
"to",
"it",
"a",
"404",
"Not",
"Found",
"will",
"be",
"returned",
"by",
"API",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L122-L128 |
163,621 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersion.java | BoxFileVersion.parseJSON | private void parseJSON(JsonObject jsonObject) {
for (JsonObject.Member member : jsonObject) {
JsonValue value = member.getValue();
if (value.isNull()) {
continue;
}
try {
String memberName = member.getName();
if (me... | java | private void parseJSON(JsonObject jsonObject) {
for (JsonObject.Member member : jsonObject) {
JsonValue value = member.getValue();
if (value.isNull()) {
continue;
}
try {
String memberName = member.getName();
if (me... | [
"private",
"void",
"parseJSON",
"(",
"JsonObject",
"jsonObject",
")",
"{",
"for",
"(",
"JsonObject",
".",
"Member",
"member",
":",
"jsonObject",
")",
"{",
"JsonValue",
"value",
"=",
"member",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"value",
".",
"isNu... | Method used to update fields with values received from API.
@param jsonObject JSON-encoded info about File Version object. | [
"Method",
"used",
"to",
"update",
"fields",
"with",
"values",
"received",
"from",
"API",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L60-L93 |
163,622 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersion.java | BoxFileVersion.download | public void download(OutputStream output, ProgressListener listener) {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxAPIResponse response = request.send();
InputStream ... | java | public void download(OutputStream output, ProgressListener listener) {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxAPIResponse response = request.send();
InputStream ... | [
"public",
"void",
"download",
"(",
"OutputStream",
"output",
",",
"ProgressListener",
"listener",
")",
"{",
"URL",
"url",
"=",
"CONTENT_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"fileI... | Downloads this version of the file to a given OutputStream while reporting the progress to a ProgressListener.
@param output the stream to where the file will be written.
@param listener a listener for monitoring the download's progress. | [
"Downloads",
"this",
"version",
"of",
"the",
"file",
"to",
"a",
"given",
"OutputStream",
"while",
"reporting",
"the",
"progress",
"to",
"a",
"ProgressListener",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L197-L218 |
163,623 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersion.java | BoxFileVersion.promote | public void promote() {
URL url = VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, "current");
JsonObject jsonObject = new JsonObject();
jsonObject.add("type", "file_version");
jsonObject.add("id", this.getID());
BoxJSONRequest request = new BoxJSONRequest(th... | java | public void promote() {
URL url = VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, "current");
JsonObject jsonObject = new JsonObject();
jsonObject.add("type", "file_version");
jsonObject.add("id", this.getID());
BoxJSONRequest request = new BoxJSONRequest(th... | [
"public",
"void",
"promote",
"(",
")",
"{",
"URL",
"url",
"=",
"VERSION_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"fileID",
",",
"\"current\"",
")",
";",
"JsonObject",
"jsonObject",
... | Promotes this version of the file to be the latest version. | [
"Promotes",
"this",
"version",
"of",
"the",
"file",
"to",
"be",
"the",
"latest",
"version",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersion.java#L223-L234 |
163,624 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.createAppUser | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) {
return createAppUser(api, name, new CreateUserParams());
} | java | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name) {
return createAppUser(api, name, new CreateUserParams());
} | [
"public",
"static",
"BoxUser",
".",
"Info",
"createAppUser",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
")",
"{",
"return",
"createAppUser",
"(",
"api",
",",
"name",
",",
"new",
"CreateUserParams",
"(",
")",
")",
";",
"}"
] | Provisions a new app user in an enterprise using Box Developer Edition.
@param api the API connection to be used by the created user.
@param name the name of the user.
@return the created user's info. | [
"Provisions",
"a",
"new",
"app",
"user",
"in",
"an",
"enterprise",
"using",
"Box",
"Developer",
"Edition",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L83-L85 |
163,625 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.createAppUser | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name,
CreateUserParams params) {
params.setIsPlatformAccessOnly(true);
return createEnterpriseUser(api, null, name, params);
} | java | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name,
CreateUserParams params) {
params.setIsPlatformAccessOnly(true);
return createEnterpriseUser(api, null, name, params);
} | [
"public",
"static",
"BoxUser",
".",
"Info",
"createAppUser",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"CreateUserParams",
"params",
")",
"{",
"params",
".",
"setIsPlatformAccessOnly",
"(",
"true",
")",
";",
"return",
"createEnterpriseUser",
"(",... | Provisions a new app user in an enterprise with additional user information using Box Developer Edition.
@param api the API connection to be used by the created user.
@param name the name of the user.
@param params additional user information.
@return the created user's info. | [
"Provisions",
"a",
"new",
"app",
"user",
"in",
"an",
"enterprise",
"with",
"additional",
"user",
"information",
"using",
"Box",
"Developer",
"Edition",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L94-L99 |
163,626 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.createEnterpriseUser | public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name) {
return createEnterpriseUser(api, login, name, null);
} | java | public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name) {
return createEnterpriseUser(api, login, name, null);
} | [
"public",
"static",
"BoxUser",
".",
"Info",
"createEnterpriseUser",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"login",
",",
"String",
"name",
")",
"{",
"return",
"createEnterpriseUser",
"(",
"api",
",",
"login",
",",
"name",
",",
"null",
")",
";",
"}"
] | Provisions a new user in an enterprise.
@param api the API connection to be used by the created user.
@param login the email address the user will use to login.
@param name the name of the user.
@return the created user's info. | [
"Provisions",
"a",
"new",
"user",
"in",
"an",
"enterprise",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L108-L110 |
163,627 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.createEnterpriseUser | public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name,
CreateUserParams params) {
JsonObject requestJSON = new JsonObject();
requestJSON.add("login", login);
requestJSON.add("name", name);
if (params != null) {
if (params.ge... | java | public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name,
CreateUserParams params) {
JsonObject requestJSON = new JsonObject();
requestJSON.add("login", login);
requestJSON.add("name", name);
if (params != null) {
if (params.ge... | [
"public",
"static",
"BoxUser",
".",
"Info",
"createEnterpriseUser",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"login",
",",
"String",
"name",
",",
"CreateUserParams",
"params",
")",
"{",
"JsonObject",
"requestJSON",
"=",
"new",
"JsonObject",
"(",
")",
";",
... | Provisions a new user in an enterprise with additional user information.
@param api the API connection to be used by the created user.
@param login the email address the user will use to login.
@param name the name of the user.
@param params additional user information.
@return the created user's info. | [
"Provisions",
"a",
"new",
"user",
"in",
"an",
"enterprise",
"with",
"additional",
"user",
"information",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L120-L158 |
163,628 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getCurrentUser | public static BoxUser getCurrentUser(BoxAPIConnection api) {
URL url = GET_ME_URL.build(api.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonObject = JsonObject.readFrom(response.getJSON... | java | public static BoxUser getCurrentUser(BoxAPIConnection api) {
URL url = GET_ME_URL.build(api.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonObject = JsonObject.readFrom(response.getJSON... | [
"public",
"static",
"BoxUser",
"getCurrentUser",
"(",
"BoxAPIConnection",
"api",
")",
"{",
"URL",
"url",
"=",
"GET_ME_URL",
".",
"build",
"(",
"api",
".",
"getBaseURL",
"(",
")",
")",
";",
"BoxAPIRequest",
"request",
"=",
"new",
"BoxAPIRequest",
"(",
"api",
... | Gets the current user.
@param api the API connection of the current user.
@return the current user. | [
"Gets",
"the",
"current",
"user",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L165-L171 |
163,629 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAllEnterpriseUsers | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
return getUsersInfoForType(api, filterTerm, null, null, fields);
} | java | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
return getUsersInfoForType(api, filterTerm, null, null, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getAllEnterpriseUsers",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"filterTerm",
",",
"final",
"String",
"...",
"fields",
")",
"{",
"return",
"getUsersInfoForType",
"(",
"ap... | Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields
to retrieve from the API.
@param api the API connection to be used when retrieving the users.
@param filterTerm used to filter the results to only users starting with this string in either the name ... | [
"Returns",
"an",
"iterable",
"containing",
"all",
"the",
"enterprise",
"users",
"that",
"matches",
"the",
"filter",
"and",
"specifies",
"which",
"child",
"fields",
"to",
"retrieve",
"from",
"the",
"API",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L191-L194 |
163,630 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAppUsersByExternalAppUserID | public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api,
final String externalAppUserId, final String... fields) {
return getUsersInfoForType(api, null, null, externalAppUserId, fields);
} | java | public static Iterable<BoxUser.Info> getAppUsersByExternalAppUserID(final BoxAPIConnection api,
final String externalAppUserId, final String... fields) {
return getUsersInfoForType(api, null, null, externalAppUserId, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getAppUsersByExternalAppUserID",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"externalAppUserId",
",",
"final",
"String",
"...",
"fields",
")",
"{",
"return",
"getUsersInfoForTyp... | Gets any app users that has an exact match with the externalAppUserId term.
@param api the API connection to be used when retrieving the users.
@param externalAppUserId the external app user id that has been set for app user
@param fields the fields to retrieve. Leave this out for the s... | [
"Gets",
"any",
"app",
"users",
"that",
"has",
"an",
"exact",
"match",
"with",
"the",
"externalAppUserId",
"term",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L235-L238 |
163,631 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getUsersInfoForType | private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api,
final String filterTerm, final String userType, final String externalAppUserId, final String... fields) {
return new Iterable<BoxUser.Info>() {
public Iterator<BoxUser.Info> iterator() {
Q... | java | private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api,
final String filterTerm, final String userType, final String externalAppUserId, final String... fields) {
return new Iterable<BoxUser.Info>() {
public Iterator<BoxUser.Info> iterator() {
Q... | [
"private",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getUsersInfoForType",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"filterTerm",
",",
"final",
"String",
"userType",
",",
"final",
"String",
"externalAppUserId",
",",
"final",
... | Helper method to abstract out the common logic from the various users methods.
@param api the API connection to be used when retrieving the users.
@param filterTerm The filter term to lookup users by (login for external, login or name for managed)
@param userType The type of users we want... | [
"Helper",
"method",
"to",
"abstract",
"out",
"the",
"common",
"logic",
"from",
"the",
"various",
"users",
"methods",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L251-L272 |
163,632 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getInfo | public BoxUser.Info getInfo(String... fields) {
URL url;
if (fields.length > 0) {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID());
} else ... | java | public BoxUser.Info getInfo(String... fields) {
URL url;
if (fields.length > 0) {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID());
} else ... | [
"public",
"BoxUser",
".",
"Info",
"getInfo",
"(",
"String",
"...",
"fields",
")",
"{",
"URL",
"url",
";",
"if",
"(",
"fields",
".",
"length",
">",
"0",
")",
"{",
"String",
"queryString",
"=",
"new",
"QueryStringBuilder",
"(",
")",
".",
"appendParam",
"... | Gets information about this user.
@param fields the optional fields to retrieve.
@return info about this user. | [
"Gets",
"information",
"about",
"this",
"user",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L279-L291 |
163,633 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getMemberships | public Collection<BoxGroupMembership.Info> getMemberships() {
BoxAPIConnection api = this.getAPI();
URL url = USER_MEMBERSHIPS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONRes... | java | public Collection<BoxGroupMembership.Info> getMemberships() {
BoxAPIConnection api = this.getAPI();
URL url = USER_MEMBERSHIPS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONRes... | [
"public",
"Collection",
"<",
"BoxGroupMembership",
".",
"Info",
">",
"getMemberships",
"(",
")",
"{",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"URL",
"url",
"=",
"USER_MEMBERSHIPS_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"g... | Gets information about all of the group memberships for this user.
Does not support paging.
<p>Note: This method is only available to enterprise admins.</p>
@return a collection of information about the group memberships for this user. | [
"Gets",
"information",
"about",
"all",
"of",
"the",
"group",
"memberships",
"for",
"this",
"user",
".",
"Does",
"not",
"support",
"paging",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L301-L320 |
163,634 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAllMemberships | public Iterable<BoxGroupMembership.Info> getAllMemberships(String ... fields) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new Iterable<BoxGroupMembership.Info>() {
public I... | java | public Iterable<BoxGroupMembership.Info> getAllMemberships(String ... fields) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new Iterable<BoxGroupMembership.Info>() {
public I... | [
"public",
"Iterable",
"<",
"BoxGroupMembership",
".",
"Info",
">",
"getAllMemberships",
"(",
"String",
"...",
"fields",
")",
"{",
"final",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",
"(",
")",
";",
"if",
"(",
"fields",
".",
"length",
">"... | Gets information about all of the group memberships for this user as iterable with paging support.
@param fields the fields to retrieve.
@return an iterable with information about the group memberships for this user. | [
"Gets",
"information",
"about",
"all",
"of",
"the",
"group",
"memberships",
"for",
"this",
"user",
"as",
"iterable",
"with",
"paging",
"support",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L327-L339 |
163,635 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.addEmailAlias | public EmailAlias addEmailAlias(String email, boolean isConfirmed) {
URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST");
JsonObject requestJSON = new JsonObject()
.add("ema... | java | public EmailAlias addEmailAlias(String email, boolean isConfirmed) {
URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST");
JsonObject requestJSON = new JsonObject()
.add("ema... | [
"public",
"EmailAlias",
"addEmailAlias",
"(",
"String",
"email",
",",
"boolean",
"isConfirmed",
")",
"{",
"URL",
"url",
"=",
"EMAIL_ALIASES_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"g... | Adds a new email alias to this user's account and confirms it without user interaction.
This functionality is only available for enterprise admins.
@param email the email address to add as an alias.
@param isConfirmed whether or not the email alias should be automatically confirmed.
@return the newly created email alia... | [
"Adds",
"a",
"new",
"email",
"alias",
"to",
"this",
"user",
"s",
"account",
"and",
"confirms",
"it",
"without",
"user",
"interaction",
".",
"This",
"functionality",
"is",
"only",
"available",
"for",
"enterprise",
"admins",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L357-L372 |
163,636 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.deleteEmailAlias | public void deleteEmailAlias(String emailAliasID) {
URL url = EMAIL_ALIAS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), emailAliasID);
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse response = request.send();
response.disconnect();
... | java | public void deleteEmailAlias(String emailAliasID) {
URL url = EMAIL_ALIAS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), emailAliasID);
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse response = request.send();
response.disconnect();
... | [
"public",
"void",
"deleteEmailAlias",
"(",
"String",
"emailAliasID",
")",
"{",
"URL",
"url",
"=",
"EMAIL_ALIAS_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
",",
"emai... | Deletes an email alias from this user's account.
<p>The IDs of the user's email aliases can be found by calling {@link #getEmailAliases}.</p>
@param emailAliasID the ID of the email alias to delete. | [
"Deletes",
"an",
"email",
"alias",
"from",
"this",
"user",
"s",
"account",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L381-L386 |
163,637 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getEmailAliases | public Collection<EmailAlias> getEmailAliases() {
URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJS... | java | public Collection<EmailAlias> getEmailAliases() {
URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJS... | [
"public",
"Collection",
"<",
"EmailAlias",
">",
"getEmailAliases",
"(",
")",
"{",
"URL",
"url",
"=",
"EMAIL_ALIASES_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
")",
... | Gets a collection of all the email aliases for this user.
<p>Note that the user's primary login email is not included in the collection of email aliases.</p>
@return a collection of all the email aliases for this user. | [
"Gets",
"a",
"collection",
"of",
"all",
"the",
"email",
"aliases",
"for",
"this",
"user",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L395-L410 |
163,638 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.delete | public void delete(boolean notifyUser, boolean force) {
String queryString = new QueryStringBuilder()
.appendParam("notify", String.valueOf(notifyUser))
.appendParam("force", String.valueOf(force))
.toString();
URL url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI()... | java | public void delete(boolean notifyUser, boolean force) {
String queryString = new QueryStringBuilder()
.appendParam("notify", String.valueOf(notifyUser))
.appendParam("force", String.valueOf(force))
.toString();
URL url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI()... | [
"public",
"void",
"delete",
"(",
"boolean",
"notifyUser",
",",
"boolean",
"force",
")",
"{",
"String",
"queryString",
"=",
"new",
"QueryStringBuilder",
"(",
")",
".",
"appendParam",
"(",
"\"notify\"",
",",
"String",
".",
"valueOf",
"(",
"notifyUser",
")",
")... | Deletes a user from an enterprise account.
@param notifyUser whether or not to send an email notification to the user that their account has been deleted.
@param force whether or not this user should be deleted even if they still own files. | [
"Deletes",
"a",
"user",
"from",
"an",
"enterprise",
"account",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L417-L427 |
163,639 | box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAvatar | public InputStream getAvatar() {
URL url = USER_AVATAR_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxAPIResponse response = request.send();
return response.getBody();
} | java | public InputStream getAvatar() {
URL url = USER_AVATAR_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxAPIResponse response = request.send();
return response.getBody();
} | [
"public",
"InputStream",
"getAvatar",
"(",
")",
"{",
"URL",
"url",
"=",
"USER_AVATAR_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
")",
";",
"BoxAPIRequest",
"request",
... | Retrieves the avatar of a user as an InputStream.
@return InputStream representing the user avater. | [
"Retrieves",
"the",
"avatar",
"of",
"a",
"user",
"as",
"an",
"InputStream",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L508-L514 |
163,640 | box/box-java-sdk | src/main/java/com/box/sdk/BoxInvite.java | BoxInvite.inviteUserToEnterprise | public static Info inviteUserToEnterprise(BoxAPIConnection api, String userLogin, String enterpriseID) {
URL url = INVITE_CREATION_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject body = new JsonObject();
JsonObject enterp... | java | public static Info inviteUserToEnterprise(BoxAPIConnection api, String userLogin, String enterpriseID) {
URL url = INVITE_CREATION_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST");
JsonObject body = new JsonObject();
JsonObject enterp... | [
"public",
"static",
"Info",
"inviteUserToEnterprise",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"userLogin",
",",
"String",
"enterpriseID",
")",
"{",
"URL",
"url",
"=",
"INVITE_CREATION_URL_TEMPLATE",
".",
"build",
"(",
"api",
".",
"getBaseURL",
"(",
")",
"... | Invite a user to an enterprise.
@param api the API connection to use for the request.
@param userLogin the login of the user to invite.
@param enterpriseID the ID of the enterprise to invite the user to.
@return the invite info. | [
"Invite",
"a",
"user",
"to",
"an",
"enterprise",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxInvite.java#L61-L82 |
163,641 | box/box-java-sdk | src/main/java/com/box/sdk/BoxWebHook.java | BoxWebHook.toJsonArray | private static JsonArray toJsonArray(Collection<String> values) {
JsonArray array = new JsonArray();
for (String value : values) {
array.add(value);
}
return array;
} | java | private static JsonArray toJsonArray(Collection<String> values) {
JsonArray array = new JsonArray();
for (String value : values) {
array.add(value);
}
return array;
} | [
"private",
"static",
"JsonArray",
"toJsonArray",
"(",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"JsonArray",
"array",
"=",
"new",
"JsonArray",
"(",
")",
";",
"for",
"(",
"String",
"value",
":",
"values",
")",
"{",
"array",
".",
"add",
"(",
... | Helper function to create JsonArray from collection.
@param values collection of values to convert to JsonArray
@return JsonArray with collection values | [
"Helper",
"function",
"to",
"create",
"JsonArray",
"from",
"collection",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHook.java#L170-L177 |
163,642 | box/box-java-sdk | src/main/java/com/box/sdk/BoxJSONRequest.java | BoxJSONRequest.setBody | @Override
public void setBody(String body) {
super.setBody(body);
this.jsonValue = JsonValue.readFrom(body);
} | java | @Override
public void setBody(String body) {
super.setBody(body);
this.jsonValue = JsonValue.readFrom(body);
} | [
"@",
"Override",
"public",
"void",
"setBody",
"(",
"String",
"body",
")",
"{",
"super",
".",
"setBody",
"(",
"body",
")",
";",
"this",
".",
"jsonValue",
"=",
"JsonValue",
".",
"readFrom",
"(",
"body",
")",
";",
"}"
] | Sets the body of this request to a given JSON string.
@param body the JSON string to use as the body. | [
"Sets",
"the",
"body",
"of",
"this",
"request",
"to",
"a",
"given",
"JSON",
"string",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONRequest.java#L54-L58 |
163,643 | box/box-java-sdk | src/main/java/com/box/sdk/BoxComment.java | BoxComment.changeMessage | public Info changeMessage(String newMessage) {
Info newInfo = new Info();
newInfo.setMessage(newMessage);
URL url = COMMENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(newIn... | java | public Info changeMessage(String newMessage) {
Info newInfo = new Info();
newInfo.setMessage(newMessage);
URL url = COMMENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(newIn... | [
"public",
"Info",
"changeMessage",
"(",
"String",
"newMessage",
")",
"{",
"Info",
"newInfo",
"=",
"new",
"Info",
"(",
")",
";",
"newInfo",
".",
"setMessage",
"(",
"newMessage",
")",
";",
"URL",
"url",
"=",
"COMMENT_URL_TEMPLATE",
".",
"build",
"(",
"this",... | Changes the message of this comment.
@param newMessage the new message for this comment.
@return updated info about this comment. | [
"Changes",
"the",
"message",
"of",
"this",
"comment",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxComment.java#L69-L80 |
163,644 | box/box-java-sdk | src/main/java/com/box/sdk/BoxComment.java | BoxComment.reply | public BoxComment.Info reply(String message) {
JsonObject itemJSON = new JsonObject();
itemJSON.add("type", "comment");
itemJSON.add("id", this.getID());
JsonObject requestJSON = new JsonObject();
requestJSON.add("item", itemJSON);
if (BoxComment.messageContainsMention(m... | java | public BoxComment.Info reply(String message) {
JsonObject itemJSON = new JsonObject();
itemJSON.add("type", "comment");
itemJSON.add("id", this.getID());
JsonObject requestJSON = new JsonObject();
requestJSON.add("item", itemJSON);
if (BoxComment.messageContainsMention(m... | [
"public",
"BoxComment",
".",
"Info",
"reply",
"(",
"String",
"message",
")",
"{",
"JsonObject",
"itemJSON",
"=",
"new",
"JsonObject",
"(",
")",
";",
"itemJSON",
".",
"add",
"(",
"\"type\"",
",",
"\"comment\"",
")",
";",
"itemJSON",
".",
"add",
"(",
"\"id... | Replies to this comment with another message.
@param message the message for the reply.
@return info about the newly created reply comment. | [
"Replies",
"to",
"this",
"comment",
"with",
"another",
"message",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxComment.java#L87-L108 |
163,645 | box/box-java-sdk | src/main/java/com/box/sdk/InMemoryLRUAccessTokenCache.java | InMemoryLRUAccessTokenCache.put | public void put(String key, String value) {
synchronized (this.cache) {
this.cache.put(key, value);
}
} | java | public void put(String key, String value) {
synchronized (this.cache) {
this.cache.put(key, value);
}
} | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"synchronized",
"(",
"this",
".",
"cache",
")",
"{",
"this",
".",
"cache",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"}"
] | Add an entry to the cache.
@param key key to use.
@param value access token information to store. | [
"Add",
"an",
"entry",
"to",
"the",
"cache",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/InMemoryLRUAccessTokenCache.java#L33-L37 |
163,646 | box/box-java-sdk | src/main/java/com/box/sdk/URLTemplate.java | URLTemplate.buildWithQuery | public URL buildWithQuery(String base, String queryString, Object... values) {
String urlString = String.format(base + this.template, values) + queryString;
URL url = null;
try {
url = new URL(urlString);
} catch (MalformedURLException e) {
assert false : "An inva... | java | public URL buildWithQuery(String base, String queryString, Object... values) {
String urlString = String.format(base + this.template, values) + queryString;
URL url = null;
try {
url = new URL(urlString);
} catch (MalformedURLException e) {
assert false : "An inva... | [
"public",
"URL",
"buildWithQuery",
"(",
"String",
"base",
",",
"String",
"queryString",
",",
"Object",
"...",
"values",
")",
"{",
"String",
"urlString",
"=",
"String",
".",
"format",
"(",
"base",
"+",
"this",
".",
"template",
",",
"values",
")",
"+",
"qu... | Build a URL with Query String and URL Parameters.
@param base base URL
@param queryString query string
@param values URL Parameters
@return URL | [
"Build",
"a",
"URL",
"with",
"Query",
"String",
"and",
"URL",
"Parameters",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/URLTemplate.java#L46-L56 |
163,647 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.uploadPart | public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize,
long totalSizeOfFile) {
URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint();
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), ... | java | public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize,
long totalSizeOfFile) {
URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint();
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), ... | [
"public",
"BoxFileUploadSessionPart",
"uploadPart",
"(",
"InputStream",
"stream",
",",
"long",
"offset",
",",
"int",
"partSize",
",",
"long",
"totalSizeOfFile",
")",
"{",
"URL",
"uploadPartURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
")"... | Uploads chunk of a stream to an open upload session.
@param stream the stream that is used to read the chunck using the offset and part size.
@param offset the byte position where the chunk begins in the file.
@param partSize the part size returned as part of the upload session instance creation.
Only the last chunk ca... | [
"Uploads",
"chunk",
"of",
"a",
"stream",
"to",
"an",
"open",
"upload",
"session",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L241-L258 |
163,648 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.uploadPart | public BoxFileUploadSessionPart uploadPart(byte[] data, long offset, int partSize,
long totalSizeOfFile) {
URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint();
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), uploadPa... | java | public BoxFileUploadSessionPart uploadPart(byte[] data, long offset, int partSize,
long totalSizeOfFile) {
URL uploadPartURL = this.sessionInfo.getSessionEndpoints().getUploadPartEndpoint();
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), uploadPa... | [
"public",
"BoxFileUploadSessionPart",
"uploadPart",
"(",
"byte",
"[",
"]",
"data",
",",
"long",
"offset",
",",
"int",
"partSize",
",",
"long",
"totalSizeOfFile",
")",
"{",
"URL",
"uploadPartURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
... | Uploads bytes to an open upload session.
@param data data
@param offset the byte position where the chunk begins in the file.
@param partSize the part size returned as part of the upload session instance creation.
Only the last chunk can have a lesser value.
@param totalSizeOfFile The total size of the file being uploa... | [
"Uploads",
"bytes",
"to",
"an",
"open",
"upload",
"session",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L269-L297 |
163,649 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.listParts | public BoxFileUploadSessionPartList listParts(int offset, int limit) {
URL listPartsURL = this.sessionInfo.getSessionEndpoints().getListPartsEndpoint();
URLTemplate template = new URLTemplate(listPartsURL.toString());
QueryStringBuilder builder = new QueryStringBuilder();
builder.append... | java | public BoxFileUploadSessionPartList listParts(int offset, int limit) {
URL listPartsURL = this.sessionInfo.getSessionEndpoints().getListPartsEndpoint();
URLTemplate template = new URLTemplate(listPartsURL.toString());
QueryStringBuilder builder = new QueryStringBuilder();
builder.append... | [
"public",
"BoxFileUploadSessionPartList",
"listParts",
"(",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"URL",
"listPartsURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
")",
".",
"getListPartsEndpoint",
"(",
")",
";",
"URLTemplate",
"... | Returns a list of all parts that have been uploaded to an upload session.
@param offset paging marker for the list of parts.
@param limit maximum number of parts to return.
@return the list of parts. | [
"Returns",
"a",
"list",
"of",
"all",
"parts",
"that",
"have",
"been",
"uploaded",
"to",
"an",
"upload",
"session",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L305-L321 |
163,650 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.commit | public BoxFile.Info commit(String digest, List<BoxFileUploadSessionPart> parts,
Map<String, String> attributes, String ifMatch, String ifNoneMatch) {
URL commitURL = this.sessionInfo.getSessionEndpoints().getCommitEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI... | java | public BoxFile.Info commit(String digest, List<BoxFileUploadSessionPart> parts,
Map<String, String> attributes, String ifMatch, String ifNoneMatch) {
URL commitURL = this.sessionInfo.getSessionEndpoints().getCommitEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI... | [
"public",
"BoxFile",
".",
"Info",
"commit",
"(",
"String",
"digest",
",",
"List",
"<",
"BoxFileUploadSessionPart",
">",
"parts",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
... | Commit an upload session after all parts have been uploaded, creating the new file or the version.
@param digest the base64-encoded SHA-1 hash of the file being uploaded.
@param parts the list of uploaded parts to be committed.
@param attributes the key value pairs of attributes from the file instance.
@param ifMatch e... | [
"Commit",
"an",
"upload",
"session",
"after",
"all",
"parts",
"have",
"been",
"uploaded",
"creating",
"the",
"new",
"file",
"or",
"the",
"version",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L332-L374 |
163,651 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.getStatus | public BoxFileUploadSession.Info getStatus() {
URL statusURL = this.sessionInfo.getSessionEndpoints().getStatusEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), statusURL, HttpMethod.GET);
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonOb... | java | public BoxFileUploadSession.Info getStatus() {
URL statusURL = this.sessionInfo.getSessionEndpoints().getStatusEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), statusURL, HttpMethod.GET);
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonOb... | [
"public",
"BoxFileUploadSession",
".",
"Info",
"getStatus",
"(",
")",
"{",
"URL",
"statusURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
")",
".",
"getStatusEndpoint",
"(",
")",
";",
"BoxJSONRequest",
"request",
"=",
"new",
"BoxJSONReques... | Get the status of the upload session. 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. | [
"Get",
"the",
"status",
"of",
"the",
"upload",
"session",
".",
"It",
"contains",
"the",
"number",
"of",
"parts",
"that",
"are",
"processed",
"so",
"far",
"the",
"total",
"number",
"of",
"parts",
"required",
"for",
"the",
"commit",
"and",
"expiration",
"dat... | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L423-L432 |
163,652 | box/box-java-sdk | src/main/java/com/box/sdk/BoxFileUploadSession.java | BoxFileUploadSession.abort | public void abort() {
URL abortURL = this.sessionInfo.getSessionEndpoints().getAbortEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), abortURL, HttpMethod.DELETE);
request.send();
} | java | public void abort() {
URL abortURL = this.sessionInfo.getSessionEndpoints().getAbortEndpoint();
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), abortURL, HttpMethod.DELETE);
request.send();
} | [
"public",
"void",
"abort",
"(",
")",
"{",
"URL",
"abortURL",
"=",
"this",
".",
"sessionInfo",
".",
"getSessionEndpoints",
"(",
")",
".",
"getAbortEndpoint",
"(",
")",
";",
"BoxJSONRequest",
"request",
"=",
"new",
"BoxJSONRequest",
"(",
"this",
".",
"getAPI",... | Abort an upload session, discarding any chunks that were uploaded to it. | [
"Abort",
"an",
"upload",
"session",
"discarding",
"any",
"chunks",
"that",
"were",
"uploaded",
"to",
"it",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L437-L441 |
163,653 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIResponse.java | BoxAPIResponse.getHeaderField | public String getHeaderField(String fieldName) {
// headers map is null for all regular response calls except when made as a batch request
if (this.headers == null) {
if (this.connection != null) {
return this.connection.getHeaderField(fieldName);
} else {
... | java | public String getHeaderField(String fieldName) {
// headers map is null for all regular response calls except when made as a batch request
if (this.headers == null) {
if (this.connection != null) {
return this.connection.getHeaderField(fieldName);
} else {
... | [
"public",
"String",
"getHeaderField",
"(",
"String",
"fieldName",
")",
"{",
"// headers map is null for all regular response calls except when made as a batch request",
"if",
"(",
"this",
".",
"headers",
"==",
"null",
")",
"{",
"if",
"(",
"this",
".",
"connection",
"!="... | Gets the value of the given header field.
@param fieldName name of the header field.
@return value of the header. | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"header",
"field",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIResponse.java#L119-L130 |
163,654 | box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIResponse.java | BoxAPIResponse.getErrorStream | private InputStream getErrorStream() {
InputStream errorStream = this.connection.getErrorStream();
if (errorStream != null) {
final String contentEncoding = this.connection.getContentEncoding();
if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) {
... | java | private InputStream getErrorStream() {
InputStream errorStream = this.connection.getErrorStream();
if (errorStream != null) {
final String contentEncoding = this.connection.getContentEncoding();
if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) {
... | [
"private",
"InputStream",
"getErrorStream",
"(",
")",
"{",
"InputStream",
"errorStream",
"=",
"this",
".",
"connection",
".",
"getErrorStream",
"(",
")",
";",
"if",
"(",
"errorStream",
"!=",
"null",
")",
"{",
"final",
"String",
"contentEncoding",
"=",
"this",
... | Returns the response error stream, handling the case when it contains gzipped data.
@return gzip decoded (if needed) error stream or null | [
"Returns",
"the",
"response",
"error",
"stream",
"handling",
"the",
"case",
"when",
"it",
"contains",
"gzipped",
"data",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIResponse.java#L281-L295 |
163,655 | box/box-java-sdk | src/main/java/com/box/sdk/BoxWebLink.java | BoxWebLink.updateInfo | public void updateInfo(BoxWebLink.Info info) {
URL url = WEB_LINK_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(info.getPendingChanges());
String body = info.getPendingChanges();
... | java | public void updateInfo(BoxWebLink.Info info) {
URL url = WEB_LINK_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(info.getPendingChanges());
String body = info.getPendingChanges();
... | [
"public",
"void",
"updateInfo",
"(",
"BoxWebLink",
".",
"Info",
"info",
")",
"{",
"URL",
"url",
"=",
"WEB_LINK_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
")",
"... | Updates the information about this weblink with any info fields that have been modified locally.
<p>The only fields that will be updated are the ones that have been modified locally. For example, the following
code won't update any information (or even send a network request) since none of the info's fields were
chang... | [
"Updates",
"the",
"information",
"about",
"this",
"weblink",
"with",
"any",
"info",
"fields",
"that",
"have",
"been",
"modified",
"locally",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebLink.java#L188-L196 |
163,656 | box/box-java-sdk | src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java | BoxStoragePolicyAssignment.create | public static BoxStoragePolicyAssignment.Info create(BoxAPIConnection api, String policyID, String userID) {
URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST);
JsonObject requestJSON = new JsonObject()... | java | public static BoxStoragePolicyAssignment.Info create(BoxAPIConnection api, String policyID, String userID) {
URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST);
JsonObject requestJSON = new JsonObject()... | [
"public",
"static",
"BoxStoragePolicyAssignment",
".",
"Info",
"create",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"policyID",
",",
"String",
"userID",
")",
"{",
"URL",
"url",
"=",
"STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE",
".",
"build",
"(",
"api",
".",
"getB... | Create a BoxStoragePolicyAssignment for a BoxStoragePolicy.
@param api the API connection to be used by the resource.
@param policyID the policy ID of the BoxStoragePolicy.
@param userID the user ID of the to assign the BoxStoragePolicy to.
@return the information abou... | [
"Create",
"a",
"BoxStoragePolicyAssignment",
"for",
"a",
"BoxStoragePolicy",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L45-L64 |
163,657 | box/box-java-sdk | src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java | BoxStoragePolicyAssignment.getAssignmentForTarget | public static BoxStoragePolicyAssignment.Info getAssignmentForTarget(final BoxAPIConnection api,
String resolvedForType, String resolvedForID) {
QueryStringBuilder builder = new QueryStringBuilder();
builder.appendParam("resolved_f... | java | public static BoxStoragePolicyAssignment.Info getAssignmentForTarget(final BoxAPIConnection api,
String resolvedForType, String resolvedForID) {
QueryStringBuilder builder = new QueryStringBuilder();
builder.appendParam("resolved_f... | [
"public",
"static",
"BoxStoragePolicyAssignment",
".",
"Info",
"getAssignmentForTarget",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"resolvedForType",
",",
"String",
"resolvedForID",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",... | Returns a BoxStoragePolicyAssignment information.
@param api the API connection to be used by the resource.
@param resolvedForType the assigned entity type for the storage policy.
@param resolvedForID the assigned entity id for the storage policy.
@return information about this {@link BoxStorageP... | [
"Returns",
"a",
"BoxStoragePolicyAssignment",
"information",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L88-L103 |
163,658 | box/box-java-sdk | src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java | BoxStoragePolicyAssignment.delete | public void delete() {
URL url = STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.DELETE);
request.send();
} | java | public void delete() {
URL url = STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.DELETE);
request.send();
} | [
"public",
"void",
"delete",
"(",
")",
"{",
"URL",
"url",
"=",
"STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
"getID",
"(",
")",
")",
";",
"BoxAPIRequest",... | Deletes this BoxStoragePolicyAssignment. | [
"Deletes",
"this",
"BoxStoragePolicyAssignment",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L119-L124 |
163,659 | box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.getAllGroupsByName | public static Iterable<BoxGroup.Info> getAllGroupsByName(final BoxAPIConnection api, String name) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (name == null || name.trim().isEmpty()) {
throw new BoxAPIException("Searching groups by name requires a non NULL or non empty n... | java | public static Iterable<BoxGroup.Info> getAllGroupsByName(final BoxAPIConnection api, String name) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (name == null || name.trim().isEmpty()) {
throw new BoxAPIException("Searching groups by name requires a non NULL or non empty n... | [
"public",
"static",
"Iterable",
"<",
"BoxGroup",
".",
"Info",
">",
"getAllGroupsByName",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"name",
")",
"{",
"final",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",
"(",
")",
";",
"if",
... | Gets an iterable of all the groups in the enterprise that are starting with the given name string.
@param api the API connection to be used when retrieving the groups.
@param name the name prefix of the groups. If the groups need to searched by full name that has spaces,
then the parameter string should have been wra... | [
"Gets",
"an",
"iterable",
"of",
"all",
"the",
"groups",
"in",
"the",
"enterprise",
"that",
"are",
"starting",
"with",
"the",
"given",
"name",
"string",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L150-L164 |
163,660 | box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.getMemberships | public Collection<BoxGroupMembership.Info> getMemberships() {
final BoxAPIConnection api = this.getAPI();
final String groupID = this.getID();
Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() {
public Iterator<BoxGroupMembership.Info> iterator() {
... | java | public Collection<BoxGroupMembership.Info> getMemberships() {
final BoxAPIConnection api = this.getAPI();
final String groupID = this.getID();
Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() {
public Iterator<BoxGroupMembership.Info> iterator() {
... | [
"public",
"Collection",
"<",
"BoxGroupMembership",
".",
"Info",
">",
"getMemberships",
"(",
")",
"{",
"final",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"final",
"String",
"groupID",
"=",
"this",
".",
"getID",
"(",
")",
";",
"... | Gets information about all of the group memberships for this group.
Does not support paging.
@return a collection of information about the group memberships for this group. | [
"Gets",
"information",
"about",
"all",
"of",
"the",
"group",
"memberships",
"for",
"this",
"group",
".",
"Does",
"not",
"support",
"paging",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L200-L218 |
163,661 | box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.addMembership | public BoxGroupMembership.Info addMembership(BoxUser user, Role role) {
BoxAPIConnection api = this.getAPI();
JsonObject requestJSON = new JsonObject();
requestJSON.add("user", new JsonObject().add("id", user.getID()));
requestJSON.add("group", new JsonObject().add("id", this.getID()));... | java | public BoxGroupMembership.Info addMembership(BoxUser user, Role role) {
BoxAPIConnection api = this.getAPI();
JsonObject requestJSON = new JsonObject();
requestJSON.add("user", new JsonObject().add("id", user.getID()));
requestJSON.add("group", new JsonObject().add("id", this.getID()));... | [
"public",
"BoxGroupMembership",
".",
"Info",
"addMembership",
"(",
"BoxUser",
"user",
",",
"Role",
"role",
")",
"{",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"JsonObject",
"requestJSON",
"=",
"new",
"JsonObject",
"(",
")",
";",
... | Adds a member to this group with the specified role.
@param user the member to be added to this group.
@param role the role of the user in this group. Can be null to assign the default role.
@return info about the new group membership. | [
"Adds",
"a",
"member",
"to",
"this",
"group",
"with",
"the",
"specified",
"role",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L254-L272 |
163,662 | box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfService.java | BoxTermsOfService.create | public static BoxTermsOfService.Info create(BoxAPIConnection api,
BoxTermsOfService.TermsOfServiceStatus termsOfServiceStatus,
BoxTermsOfService.TermsOfServiceType termsOfServiceType, String text) {
URL url = ALL_TER... | java | public static BoxTermsOfService.Info create(BoxAPIConnection api,
BoxTermsOfService.TermsOfServiceStatus termsOfServiceStatus,
BoxTermsOfService.TermsOfServiceType termsOfServiceType, String text) {
URL url = ALL_TER... | [
"public",
"static",
"BoxTermsOfService",
".",
"Info",
"create",
"(",
"BoxAPIConnection",
"api",
",",
"BoxTermsOfService",
".",
"TermsOfServiceStatus",
"termsOfServiceStatus",
",",
"BoxTermsOfService",
".",
"TermsOfServiceType",
"termsOfServiceType",
",",
"String",
"text",
... | Creates a new Terms of Services.
@param api the API connection to be used by the resource.
@param termsOfServiceStatus the current status of the terms of services. Set to "enabled" or "disabled".
@param termsOfServiceType the scope of terms of service. Set to "external" or "managed".
@... | [
"Creates",
"a",
"new",
"Terms",
"of",
"Services",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfService.java#L44-L60 |
163,663 | box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfService.java | BoxTermsOfService.getAllTermsOfServices | public static List<BoxTermsOfService.Info> getAllTermsOfServices(final BoxAPIConnection api,
BoxTermsOfService.TermsOfServiceType
termsOfServiceType) {
QueryStringBui... | java | public static List<BoxTermsOfService.Info> getAllTermsOfServices(final BoxAPIConnection api,
BoxTermsOfService.TermsOfServiceType
termsOfServiceType) {
QueryStringBui... | [
"public",
"static",
"List",
"<",
"BoxTermsOfService",
".",
"Info",
">",
"getAllTermsOfServices",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"BoxTermsOfService",
".",
"TermsOfServiceType",
"termsOfServiceType",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"new",
... | Retrieves a list of Terms of Service that belong to your Enterprise as an Iterable.
@param api api the API connection to be used by the resource.
@param termsOfServiceType the type of terms of service to be retrieved. Can be set to "managed" or "external"
@return the Iterable o... | [
"Retrieves",
"a",
"list",
"of",
"Terms",
"of",
"Service",
"that",
"belong",
"to",
"your",
"Enterprise",
"as",
"an",
"Iterable",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfService.java#L102-L126 |
163,664 | box/box-java-sdk | src/main/java/com/box/sdk/internal/utils/Parsers.java | Parsers.parseAndPopulateMetadataMap | public static Map<String, Map<String, Metadata>> parseAndPopulateMetadataMap(JsonObject jsonObject) {
Map<String, Map<String, Metadata>> metadataMap = new HashMap<String, Map<String, Metadata>>();
//Parse all templates
for (JsonObject.Member templateMember : jsonObject) {
if (templat... | java | public static Map<String, Map<String, Metadata>> parseAndPopulateMetadataMap(JsonObject jsonObject) {
Map<String, Map<String, Metadata>> metadataMap = new HashMap<String, Map<String, Metadata>>();
//Parse all templates
for (JsonObject.Member templateMember : jsonObject) {
if (templat... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Metadata",
">",
">",
"parseAndPopulateMetadataMap",
"(",
"JsonObject",
"jsonObject",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Metadata",
">",
">",
"metadataM... | Creates a map of metadata from json.
@param jsonObject metadata json object for metadata field in get /files?fileds=,etadata.scope.template response
@return Map of String as key a value another Map with a String key and Metadata value | [
"Creates",
"a",
"map",
"of",
"metadata",
"from",
"json",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/internal/utils/Parsers.java#L29-L53 |
163,665 | box/box-java-sdk | src/main/java/com/box/sdk/internal/utils/Parsers.java | Parsers.parseRepresentations | public static List<Representation> parseRepresentations(JsonObject jsonObject) {
List<Representation> representations = new ArrayList<Representation>();
for (JsonValue representationJson : jsonObject.get("entries").asArray()) {
Representation representation = new Representation(representatio... | java | public static List<Representation> parseRepresentations(JsonObject jsonObject) {
List<Representation> representations = new ArrayList<Representation>();
for (JsonValue representationJson : jsonObject.get("entries").asArray()) {
Representation representation = new Representation(representatio... | [
"public",
"static",
"List",
"<",
"Representation",
">",
"parseRepresentations",
"(",
"JsonObject",
"jsonObject",
")",
"{",
"List",
"<",
"Representation",
">",
"representations",
"=",
"new",
"ArrayList",
"<",
"Representation",
">",
"(",
")",
";",
"for",
"(",
"J... | Parse representations from a file object response.
@param jsonObject representations json object in get response for /files/file-id?fields=representations
@return list of representations | [
"Parse",
"representations",
"from",
"a",
"file",
"object",
"response",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/internal/utils/Parsers.java#L60-L67 |
163,666 | box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java | BoxTermsOfServiceUserStatus.updateInfo | public void updateInfo(BoxTermsOfServiceUserStatus.Info info) {
URL url = TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(info.getPendingChanges());
BoxJSONRe... | java | public void updateInfo(BoxTermsOfServiceUserStatus.Info info) {
URL url = TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
request.setBody(info.getPendingChanges());
BoxJSONRe... | [
"public",
"void",
"updateInfo",
"(",
"BoxTermsOfServiceUserStatus",
".",
"Info",
"info",
")",
"{",
"URL",
"url",
"=",
"TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
... | Updates the information about the user status for this terms of service with any info fields that have
been modified locally.
@param info the updated info. | [
"Updates",
"the",
"information",
"about",
"the",
"user",
"status",
"for",
"this",
"terms",
"of",
"service",
"with",
"any",
"info",
"fields",
"that",
"have",
"been",
"modified",
"locally",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java#L133-L141 |
163,667 | box/box-java-sdk | src/main/java/com/box/sdk/BatchAPIRequest.java | BatchAPIRequest.execute | public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests) {
this.prepareRequest(requests);
BoxJSONResponse batchResponse = (BoxJSONResponse) send();
return this.parseResponse(batchResponse);
} | java | public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests) {
this.prepareRequest(requests);
BoxJSONResponse batchResponse = (BoxJSONResponse) send();
return this.parseResponse(batchResponse);
} | [
"public",
"List",
"<",
"BoxAPIResponse",
">",
"execute",
"(",
"List",
"<",
"BoxAPIRequest",
">",
"requests",
")",
"{",
"this",
".",
"prepareRequest",
"(",
"requests",
")",
";",
"BoxJSONResponse",
"batchResponse",
"=",
"(",
"BoxJSONResponse",
")",
"send",
"(",
... | Execute a set of API calls as batch request.
@param requests list of api requests that has to be executed in batch.
@return list of BoxAPIResponses | [
"Execute",
"a",
"set",
"of",
"API",
"calls",
"as",
"batch",
"request",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L44-L48 |
163,668 | box/box-java-sdk | src/main/java/com/box/sdk/BatchAPIRequest.java | BatchAPIRequest.prepareRequest | protected void prepareRequest(List<BoxAPIRequest> requests) {
JsonObject body = new JsonObject();
JsonArray requestsJSONArray = new JsonArray();
for (BoxAPIRequest request: requests) {
JsonObject batchRequest = new JsonObject();
batchRequest.add("method", request.getMetho... | java | protected void prepareRequest(List<BoxAPIRequest> requests) {
JsonObject body = new JsonObject();
JsonArray requestsJSONArray = new JsonArray();
for (BoxAPIRequest request: requests) {
JsonObject batchRequest = new JsonObject();
batchRequest.add("method", request.getMetho... | [
"protected",
"void",
"prepareRequest",
"(",
"List",
"<",
"BoxAPIRequest",
">",
"requests",
")",
"{",
"JsonObject",
"body",
"=",
"new",
"JsonObject",
"(",
")",
";",
"JsonArray",
"requestsJSONArray",
"=",
"new",
"JsonArray",
"(",
")",
";",
"for",
"(",
"BoxAPIR... | Prepare a batch api request using list of individual reuests.
@param requests list of api requests that has to be executed in batch. | [
"Prepare",
"a",
"batch",
"api",
"request",
"using",
"list",
"of",
"individual",
"reuests",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L54-L84 |
163,669 | box/box-java-sdk | src/main/java/com/box/sdk/BatchAPIRequest.java | BatchAPIRequest.parseResponse | protected List<BoxAPIResponse> parseResponse(BoxJSONResponse batchResponse) {
JsonObject responseJSON = JsonObject.readFrom(batchResponse.getJSON());
List<BoxAPIResponse> responses = new ArrayList<BoxAPIResponse>();
Iterator<JsonValue> responseIterator = responseJSON.get("responses").asArray().i... | java | protected List<BoxAPIResponse> parseResponse(BoxJSONResponse batchResponse) {
JsonObject responseJSON = JsonObject.readFrom(batchResponse.getJSON());
List<BoxAPIResponse> responses = new ArrayList<BoxAPIResponse>();
Iterator<JsonValue> responseIterator = responseJSON.get("responses").asArray().i... | [
"protected",
"List",
"<",
"BoxAPIResponse",
">",
"parseResponse",
"(",
"BoxJSONResponse",
"batchResponse",
")",
"{",
"JsonObject",
"responseJSON",
"=",
"JsonObject",
".",
"readFrom",
"(",
"batchResponse",
".",
"getJSON",
"(",
")",
")",
";",
"List",
"<",
"BoxAPIR... | Parses btch api response to create a list of BoxAPIResponse objects.
@param batchResponse response of a batch api request
@return list of BoxAPIResponses | [
"Parses",
"btch",
"api",
"response",
"to",
"create",
"a",
"list",
"of",
"BoxAPIResponse",
"objects",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L91-L125 |
163,670 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/util/ScanUtil.java | ScanUtil.generateJson | private static void generateJson(CellScanner cellScanner, Function<Bytes, String> encoder,
PrintStream out) throws JsonIOException {
Gson gson = new GsonBuilder().serializeNulls().setDateFormat(DateFormat.LONG)
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).setVersion(1.0)
... | java | private static void generateJson(CellScanner cellScanner, Function<Bytes, String> encoder,
PrintStream out) throws JsonIOException {
Gson gson = new GsonBuilder().serializeNulls().setDateFormat(DateFormat.LONG)
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).setVersion(1.0)
... | [
"private",
"static",
"void",
"generateJson",
"(",
"CellScanner",
"cellScanner",
",",
"Function",
"<",
"Bytes",
",",
"String",
">",
"encoder",
",",
"PrintStream",
"out",
")",
"throws",
"JsonIOException",
"{",
"Gson",
"gson",
"=",
"new",
"GsonBuilder",
"(",
")",... | Generate JSON format as result of the scan.
@since 1.2 | [
"Generate",
"JSON",
"format",
"as",
"result",
"of",
"the",
"scan",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/ScanUtil.java#L181-L202 |
163,671 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/TxInfo.java | TxInfo.getTransactionInfo | public static TxInfo getTransactionInfo(Environment env, Bytes prow, Column pcol, long startTs) {
// TODO ensure primary is visible
IteratorSetting is = new IteratorSetting(10, RollbackCheckIterator.class);
RollbackCheckIterator.setLocktime(is, startTs);
Entry<Key, Value> entry = ColumnUtil.checkColum... | java | public static TxInfo getTransactionInfo(Environment env, Bytes prow, Column pcol, long startTs) {
// TODO ensure primary is visible
IteratorSetting is = new IteratorSetting(10, RollbackCheckIterator.class);
RollbackCheckIterator.setLocktime(is, startTs);
Entry<Key, Value> entry = ColumnUtil.checkColum... | [
"public",
"static",
"TxInfo",
"getTransactionInfo",
"(",
"Environment",
"env",
",",
"Bytes",
"prow",
",",
"Column",
"pcol",
",",
"long",
"startTs",
")",
"{",
"// TODO ensure primary is visible",
"IteratorSetting",
"is",
"=",
"new",
"IteratorSetting",
"(",
"10",
",... | determine the what state a transaction is in by inspecting the primary column | [
"determine",
"the",
"what",
"state",
"a",
"transaction",
"is",
"in",
"by",
"inspecting",
"the",
"primary",
"column"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TxInfo.java#L40-L102 |
163,672 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/util/OracleServerUtils.java | OracleServerUtils.oracleExists | public static boolean oracleExists(CuratorFramework curator) {
boolean exists = false;
try {
exists = curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null
&& !curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).isEmpty();
} catch (Exception nne) {
if (nne instanceo... | java | public static boolean oracleExists(CuratorFramework curator) {
boolean exists = false;
try {
exists = curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null
&& !curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).isEmpty();
} catch (Exception nne) {
if (nne instanceo... | [
"public",
"static",
"boolean",
"oracleExists",
"(",
"CuratorFramework",
"curator",
")",
"{",
"boolean",
"exists",
"=",
"false",
";",
"try",
"{",
"exists",
"=",
"curator",
".",
"checkExists",
"(",
")",
".",
"forPath",
"(",
"ZookeeperPath",
".",
"ORACLE_SERVER",... | Checks to see if an Oracle Server exists.
@param curator It is the responsibility of the caller to ensure the curator is started
@return boolean if the server exists in zookeeper | [
"Checks",
"to",
"see",
"if",
"an",
"Oracle",
"Server",
"exists",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/OracleServerUtils.java#L32-L45 |
163,673 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java | SharedBatchWriter.waitForAsyncFlush | public void waitForAsyncFlush() {
long numAdded = asyncBatchesAdded.get();
synchronized (this) {
while (numAdded > asyncBatchesProcessed) {
try {
wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
} | java | public void waitForAsyncFlush() {
long numAdded = asyncBatchesAdded.get();
synchronized (this) {
while (numAdded > asyncBatchesProcessed) {
try {
wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
} | [
"public",
"void",
"waitForAsyncFlush",
"(",
")",
"{",
"long",
"numAdded",
"=",
"asyncBatchesAdded",
".",
"get",
"(",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"while",
"(",
"numAdded",
">",
"asyncBatchesProcessed",
")",
"{",
"try",
"{",
"wait",
"(",... | waits for all async mutations that were added before this was called to be flushed. Does not
wait for async mutations added after call. | [
"waits",
"for",
"all",
"async",
"mutations",
"that",
"were",
"added",
"before",
"this",
"was",
"called",
"to",
"be",
"flushed",
".",
"Does",
"not",
"wait",
"for",
"async",
"mutations",
"added",
"after",
"call",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java#L216-L228 |
163,674 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Span.java | Span.exact | public static Span exact(Bytes row) {
Objects.requireNonNull(row);
return new Span(row, true, row, true);
} | java | public static Span exact(Bytes row) {
Objects.requireNonNull(row);
return new Span(row, true, row, true);
} | [
"public",
"static",
"Span",
"exact",
"(",
"Bytes",
"row",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"row",
")",
";",
"return",
"new",
"Span",
"(",
"row",
",",
"true",
",",
"row",
",",
"true",
")",
";",
"}"
] | Creates a span that covers an exact row | [
"Creates",
"a",
"span",
"that",
"covers",
"an",
"exact",
"row"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L206-L209 |
163,675 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Span.java | Span.exact | public static Span exact(CharSequence row) {
Objects.requireNonNull(row);
return exact(Bytes.of(row));
} | java | public static Span exact(CharSequence row) {
Objects.requireNonNull(row);
return exact(Bytes.of(row));
} | [
"public",
"static",
"Span",
"exact",
"(",
"CharSequence",
"row",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"row",
")",
";",
"return",
"exact",
"(",
"Bytes",
".",
"of",
"(",
"row",
")",
")",
";",
"}"
] | Creates a Span that covers an exact row. String parameters will be encoded as UTF-8 | [
"Creates",
"a",
"Span",
"that",
"covers",
"an",
"exact",
"row",
".",
"String",
"parameters",
"will",
"be",
"encoded",
"as",
"UTF",
"-",
"8"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L214-L217 |
163,676 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Span.java | Span.prefix | public static Span prefix(Bytes rowPrefix) {
Objects.requireNonNull(rowPrefix);
Bytes fp = followingPrefix(rowPrefix);
return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false);
} | java | public static Span prefix(Bytes rowPrefix) {
Objects.requireNonNull(rowPrefix);
Bytes fp = followingPrefix(rowPrefix);
return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false);
} | [
"public",
"static",
"Span",
"prefix",
"(",
"Bytes",
"rowPrefix",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"rowPrefix",
")",
";",
"Bytes",
"fp",
"=",
"followingPrefix",
"(",
"rowPrefix",
")",
";",
"return",
"new",
"Span",
"(",
"rowPrefix",
",",
"tru... | Returns a Span that covers all rows beginning with a prefix. | [
"Returns",
"a",
"Span",
"that",
"covers",
"all",
"rows",
"beginning",
"with",
"a",
"prefix",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L266-L270 |
163,677 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Span.java | Span.prefix | public static Span prefix(CharSequence rowPrefix) {
Objects.requireNonNull(rowPrefix);
return prefix(Bytes.of(rowPrefix));
} | java | public static Span prefix(CharSequence rowPrefix) {
Objects.requireNonNull(rowPrefix);
return prefix(Bytes.of(rowPrefix));
} | [
"public",
"static",
"Span",
"prefix",
"(",
"CharSequence",
"rowPrefix",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"rowPrefix",
")",
";",
"return",
"prefix",
"(",
"Bytes",
".",
"of",
"(",
"rowPrefix",
")",
")",
";",
"}"
] | Returns a Span that covers all rows beginning with a prefix String parameters will be encoded
as UTF-8 | [
"Returns",
"a",
"Span",
"that",
"covers",
"all",
"rows",
"beginning",
"with",
"a",
"prefix",
"String",
"parameters",
"will",
"be",
"encoded",
"as",
"UTF",
"-",
"8"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L276-L279 |
163,678 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java | SimpleConfiguration.load | public void load(InputStream in) {
try {
PropertiesConfiguration config = new PropertiesConfiguration();
// disabled to prevent accumulo classpath value from being shortened
config.setDelimiterParsingDisabled(true);
config.load(in);
((CompositeConfiguration) internalConfig).addConfigur... | java | public void load(InputStream in) {
try {
PropertiesConfiguration config = new PropertiesConfiguration();
// disabled to prevent accumulo classpath value from being shortened
config.setDelimiterParsingDisabled(true);
config.load(in);
((CompositeConfiguration) internalConfig).addConfigur... | [
"public",
"void",
"load",
"(",
"InputStream",
"in",
")",
"{",
"try",
"{",
"PropertiesConfiguration",
"config",
"=",
"new",
"PropertiesConfiguration",
"(",
")",
";",
"// disabled to prevent accumulo classpath value from being shortened",
"config",
".",
"setDelimiterParsingDi... | Loads configuration from InputStream. Later loads have lower priority.
@param in InputStream to load from
@since 1.2.0 | [
"Loads",
"configuration",
"from",
"InputStream",
".",
"Later",
"loads",
"have",
"lower",
"priority",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java#L176-L186 |
163,679 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java | SimpleConfiguration.load | public void load(File file) {
try {
PropertiesConfiguration config = new PropertiesConfiguration();
// disabled to prevent accumulo classpath value from being shortened
config.setDelimiterParsingDisabled(true);
config.load(file);
((CompositeConfiguration) internalConfig).addConfigurati... | java | public void load(File file) {
try {
PropertiesConfiguration config = new PropertiesConfiguration();
// disabled to prevent accumulo classpath value from being shortened
config.setDelimiterParsingDisabled(true);
config.load(file);
((CompositeConfiguration) internalConfig).addConfigurati... | [
"public",
"void",
"load",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"PropertiesConfiguration",
"config",
"=",
"new",
"PropertiesConfiguration",
"(",
")",
";",
"// disabled to prevent accumulo classpath value from being shortened",
"config",
".",
"setDelimiterParsingDisable... | Loads configuration from File. Later loads have lower priority.
@param file File to load from
@since 1.2.0 | [
"Loads",
"configuration",
"from",
"File",
".",
"Later",
"loads",
"have",
"lower",
"priority",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java#L194-L204 |
163,680 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java | FluoConfigurationImpl.getTxInfoCacheWeight | public static long getTxInfoCacheWeight(FluoConfiguration conf) {
long size = conf.getLong(TX_INFO_CACHE_WEIGHT, TX_INFO_CACHE_WEIGHT_DEFAULT);
if (size <= 0) {
throw new IllegalArgumentException("Cache size must be positive for " + TX_INFO_CACHE_WEIGHT);
}
return size;
} | java | public static long getTxInfoCacheWeight(FluoConfiguration conf) {
long size = conf.getLong(TX_INFO_CACHE_WEIGHT, TX_INFO_CACHE_WEIGHT_DEFAULT);
if (size <= 0) {
throw new IllegalArgumentException("Cache size must be positive for " + TX_INFO_CACHE_WEIGHT);
}
return size;
} | [
"public",
"static",
"long",
"getTxInfoCacheWeight",
"(",
"FluoConfiguration",
"conf",
")",
"{",
"long",
"size",
"=",
"conf",
".",
"getLong",
"(",
"TX_INFO_CACHE_WEIGHT",
",",
"TX_INFO_CACHE_WEIGHT_DEFAULT",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"th... | Gets the txinfo cache weight
@param conf The FluoConfiguration
@return The size of the cache value from the property value {@value #TX_INFO_CACHE_WEIGHT} if
it is set, else the value of the default value {@value #TX_INFO_CACHE_WEIGHT_DEFAULT} | [
"Gets",
"the",
"txinfo",
"cache",
"weight"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L118-L124 |
163,681 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java | FluoConfigurationImpl.getVisibilityCacheWeight | public static long getVisibilityCacheWeight(FluoConfiguration conf) {
long size = conf.getLong(VISIBILITY_CACHE_WEIGHT, VISIBILITY_CACHE_WEIGHT_DEFAULT);
if (size <= 0) {
throw new IllegalArgumentException(
"Cache size must be positive for " + VISIBILITY_CACHE_WEIGHT);
}
return size;
} | java | public static long getVisibilityCacheWeight(FluoConfiguration conf) {
long size = conf.getLong(VISIBILITY_CACHE_WEIGHT, VISIBILITY_CACHE_WEIGHT_DEFAULT);
if (size <= 0) {
throw new IllegalArgumentException(
"Cache size must be positive for " + VISIBILITY_CACHE_WEIGHT);
}
return size;
} | [
"public",
"static",
"long",
"getVisibilityCacheWeight",
"(",
"FluoConfiguration",
"conf",
")",
"{",
"long",
"size",
"=",
"conf",
".",
"getLong",
"(",
"VISIBILITY_CACHE_WEIGHT",
",",
"VISIBILITY_CACHE_WEIGHT_DEFAULT",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
... | Gets the visibility cache weight
@param conf The FluoConfiguration
@return The size of the cache value from the property value {@value #VISIBILITY_CACHE_WEIGHT}
if it is set, else the value of the default value
{@value #VISIBILITY_CACHE_WEIGHT_DEFAULT} | [
"Gets",
"the",
"visibility",
"cache",
"weight"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L159-L166 |
163,682 | apache/fluo | modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java | ZookeeperUtil.parseServers | public static String parseServers(String zookeepers) {
int slashIndex = zookeepers.indexOf("/");
if (slashIndex != -1) {
return zookeepers.substring(0, slashIndex);
}
return zookeepers;
} | java | public static String parseServers(String zookeepers) {
int slashIndex = zookeepers.indexOf("/");
if (slashIndex != -1) {
return zookeepers.substring(0, slashIndex);
}
return zookeepers;
} | [
"public",
"static",
"String",
"parseServers",
"(",
"String",
"zookeepers",
")",
"{",
"int",
"slashIndex",
"=",
"zookeepers",
".",
"indexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"slashIndex",
"!=",
"-",
"1",
")",
"{",
"return",
"zookeepers",
".",
"substring"... | Parses server section of Zookeeper connection string | [
"Parses",
"server",
"section",
"of",
"Zookeeper",
"connection",
"string"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L41-L47 |
163,683 | apache/fluo | modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java | ZookeeperUtil.parseRoot | public static String parseRoot(String zookeepers) {
int slashIndex = zookeepers.indexOf("/");
if (slashIndex != -1) {
return zookeepers.substring(slashIndex).trim();
}
return "/";
} | java | public static String parseRoot(String zookeepers) {
int slashIndex = zookeepers.indexOf("/");
if (slashIndex != -1) {
return zookeepers.substring(slashIndex).trim();
}
return "/";
} | [
"public",
"static",
"String",
"parseRoot",
"(",
"String",
"zookeepers",
")",
"{",
"int",
"slashIndex",
"=",
"zookeepers",
".",
"indexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"slashIndex",
"!=",
"-",
"1",
")",
"{",
"return",
"zookeepers",
".",
"substring",
... | Parses chroot section of Zookeeper connection string
@param zookeepers Zookeeper connection string
@return Returns root path or "/" if none found | [
"Parses",
"chroot",
"section",
"of",
"Zookeeper",
"connection",
"string"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L55-L61 |
163,684 | apache/fluo | modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java | ZookeeperUtil.getGcTimestamp | public static long getGcTimestamp(String zookeepers) {
ZooKeeper zk = null;
try {
zk = new ZooKeeper(zookeepers, 30000, null);
// wait until zookeeper is connected
long start = System.currentTimeMillis();
while (!zk.getState().isConnected() && System.currentTimeMillis() - start < 30000)... | java | public static long getGcTimestamp(String zookeepers) {
ZooKeeper zk = null;
try {
zk = new ZooKeeper(zookeepers, 30000, null);
// wait until zookeeper is connected
long start = System.currentTimeMillis();
while (!zk.getState().isConnected() && System.currentTimeMillis() - start < 30000)... | [
"public",
"static",
"long",
"getGcTimestamp",
"(",
"String",
"zookeepers",
")",
"{",
"ZooKeeper",
"zk",
"=",
"null",
";",
"try",
"{",
"zk",
"=",
"new",
"ZooKeeper",
"(",
"zookeepers",
",",
"30000",
",",
"null",
")",
";",
"// wait until zookeeper is connected",... | Retrieves the GC timestamp, set by the Oracle, from zookeeper
@param zookeepers Zookeeper connection string
@return Oldest active timestamp or oldest possible ts (-1) if not found | [
"Retrieves",
"the",
"GC",
"timestamp",
"set",
"by",
"the",
"Oracle",
"from",
"zookeeper"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L69-L94 |
163,685 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/util/ByteUtil.java | ByteUtil.toBytes | public static Bytes toBytes(Text t) {
return Bytes.of(t.getBytes(), 0, t.getLength());
} | java | public static Bytes toBytes(Text t) {
return Bytes.of(t.getBytes(), 0, t.getLength());
} | [
"public",
"static",
"Bytes",
"toBytes",
"(",
"Text",
"t",
")",
"{",
"return",
"Bytes",
".",
"of",
"(",
"t",
".",
"getBytes",
"(",
")",
",",
"0",
",",
"t",
".",
"getLength",
"(",
")",
")",
";",
"}"
] | Convert from Hadoop Text to Bytes | [
"Convert",
"from",
"Hadoop",
"Text",
"to",
"Bytes"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/ByteUtil.java#L48-L50 |
163,686 | apache/fluo | modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoEntryInputFormat.java | FluoEntryInputFormat.configure | public static void configure(Job conf, SimpleConfiguration config) {
try {
FluoConfiguration fconfig = new FluoConfiguration(config);
try (Environment env = new Environment(fconfig)) {
long ts =
env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp();
... | java | public static void configure(Job conf, SimpleConfiguration config) {
try {
FluoConfiguration fconfig = new FluoConfiguration(config);
try (Environment env = new Environment(fconfig)) {
long ts =
env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp();
... | [
"public",
"static",
"void",
"configure",
"(",
"Job",
"conf",
",",
"SimpleConfiguration",
"config",
")",
"{",
"try",
"{",
"FluoConfiguration",
"fconfig",
"=",
"new",
"FluoConfiguration",
"(",
"config",
")",
";",
"try",
"(",
"Environment",
"env",
"=",
"new",
"... | Configure properties needed to connect to a Fluo application
@param conf Job configuration
@param config use {@link FluoConfiguration} to configure programmatically | [
"Configure",
"properties",
"needed",
"to",
"connect",
"to",
"a",
"Fluo",
"application"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoEntryInputFormat.java#L144-L167 |
163,687 | apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java | TransactionImpl.readUnread | private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) {
// TODO make async
// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user
// may not iterate over entire range
Map<Bytes, Set<Column>> columnsToRead = new HashMap<>();
for (Entry<B... | java | private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) {
// TODO make async
// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user
// may not iterate over entire range
Map<Bytes, Set<Column>> columnsToRead = new HashMap<>();
for (Entry<B... | [
"private",
"void",
"readUnread",
"(",
"CommitData",
"cd",
",",
"Consumer",
"<",
"Entry",
"<",
"Key",
",",
"Value",
">",
">",
"locksSeen",
")",
"{",
"// TODO make async",
"// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user",
"// may... | This function helps handle the following case
<OL>
<LI>TX1 locls r1 col1
<LI>TX1 fails before unlocking
<LI>TX2 attempts to write r1:col1 w/o reading it
</OL>
<p>
In this case TX2 would not roll back TX1, because it never read the column. This function
attempts to handle this case if TX2 fails. Only doing this in cas... | [
"This",
"function",
"helps",
"handle",
"the",
"following",
"case"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java#L557-L579 |
163,688 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.byteAt | public byte byteAt(int i) {
if (i < 0) {
throw new IndexOutOfBoundsException("i < 0, " + i);
}
if (i >= length) {
throw new IndexOutOfBoundsException("i >= length, " + i + " >= " + length);
}
return data[offset + i];
} | java | public byte byteAt(int i) {
if (i < 0) {
throw new IndexOutOfBoundsException("i < 0, " + i);
}
if (i >= length) {
throw new IndexOutOfBoundsException("i >= length, " + i + " >= " + length);
}
return data[offset + i];
} | [
"public",
"byte",
"byteAt",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"i < 0, \"",
"+",
"i",
")",
";",
"}",
"if",
"(",
"i",
">=",
"length",
")",
"{",
"throw",
"new",
"IndexOut... | Gets a byte within this sequence of bytes
@param i index into sequence
@return byte
@throws IllegalArgumentException if i is out of range | [
"Gets",
"a",
"byte",
"within",
"this",
"sequence",
"of",
"bytes"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L103-L114 |
163,689 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.subSequence | public Bytes subSequence(int start, int end) {
if (start > end || start < 0 || end > length) {
throw new IndexOutOfBoundsException("Bad start and/end start = " + start + " end=" + end
+ " offset=" + offset + " length=" + length);
}
return new Bytes(data, offset + start, end - start);
} | java | public Bytes subSequence(int start, int end) {
if (start > end || start < 0 || end > length) {
throw new IndexOutOfBoundsException("Bad start and/end start = " + start + " end=" + end
+ " offset=" + offset + " length=" + length);
}
return new Bytes(data, offset + start, end - start);
} | [
"public",
"Bytes",
"subSequence",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
">",
"end",
"||",
"start",
"<",
"0",
"||",
"end",
">",
"length",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Bad start and/end start ... | Returns a portion of the Bytes object
@param start index of subsequence start (inclusive)
@param end index of subsequence end (exclusive) | [
"Returns",
"a",
"portion",
"of",
"the",
"Bytes",
"object"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L129-L135 |
163,690 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.toArray | public byte[] toArray() {
byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, length);
return copy;
} | java | public byte[] toArray() {
byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, length);
return copy;
} | [
"public",
"byte",
"[",
"]",
"toArray",
"(",
")",
"{",
"byte",
"[",
"]",
"copy",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"data",
",",
"offset",
",",
"copy",
",",
"0",
",",
"length",
")",
";",
"return",
"copy",... | Returns a byte array containing a copy of the bytes | [
"Returns",
"a",
"byte",
"array",
"containing",
"a",
"copy",
"of",
"the",
"bytes"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L140-L144 |
163,691 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.contentEquals | public boolean contentEquals(byte[] bytes, int offset, int len) {
Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length);
return contentEqualsUnchecked(bytes, offset, len);
} | java | public boolean contentEquals(byte[] bytes, int offset, int len) {
Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length);
return contentEqualsUnchecked(bytes, offset, len);
} | [
"public",
"boolean",
"contentEquals",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"len",
">=",
"0",
"&&",
"offset",
">=",
"0",
"&&",
"offset",
"+",
"len",
"<=",
"bytes",... | Returns true if this Bytes object equals another. This method checks it's arguments.
@since 1.2.0 | [
"Returns",
"true",
"if",
"this",
"Bytes",
"object",
"equals",
"another",
".",
"This",
"method",
"checks",
"it",
"s",
"arguments",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L298-L301 |
163,692 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.contentEqualsUnchecked | private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) {
if (length != len) {
return false;
}
return compareToUnchecked(bytes, offset, len) == 0;
} | java | private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) {
if (length != len) {
return false;
}
return compareToUnchecked(bytes, offset, len) == 0;
} | [
"private",
"boolean",
"contentEqualsUnchecked",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"if",
"(",
"length",
"!=",
"len",
")",
"{",
"return",
"false",
";",
"}",
"return",
"compareToUnchecked",
"(",
"bytes",
",",... | Returns true if this Bytes object equals another. This method doesn't check it's arguments.
@since 1.2.0 | [
"Returns",
"true",
"if",
"this",
"Bytes",
"object",
"equals",
"another",
".",
"This",
"method",
"doesn",
"t",
"check",
"it",
"s",
"arguments",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L308-L314 |
163,693 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(byte[] array) {
Objects.requireNonNull(array);
if (array.length == 0) {
return EMPTY;
}
byte[] copy = new byte[array.length];
System.arraycopy(array, 0, copy, 0, array.length);
return new Bytes(copy);
} | java | public static final Bytes of(byte[] array) {
Objects.requireNonNull(array);
if (array.length == 0) {
return EMPTY;
}
byte[] copy = new byte[array.length];
System.arraycopy(array, 0, copy, 0, array.length);
return new Bytes(copy);
} | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"byte",
"[",
"]",
"array",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"array",
")",
";",
"if",
"(",
"array",
".",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY",
";",
"}",
"byte",
"[",
"]",
... | Creates a Bytes object by copying the data of the given byte array | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"data",
"of",
"the",
"given",
"byte",
"array"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L332-L340 |
163,694 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(byte[] data, int offset, int length) {
Objects.requireNonNull(data);
if (length == 0) {
return EMPTY;
}
byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, length);
return new Bytes(copy);
} | java | public static final Bytes of(byte[] data, int offset, int length) {
Objects.requireNonNull(data);
if (length == 0) {
return EMPTY;
}
byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, length);
return new Bytes(copy);
} | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"data",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY",
"... | Creates a Bytes object by copying the data of a subsequence of the given byte array
@param data Byte data
@param offset Starting offset in byte array (inclusive)
@param length Number of bytes to include | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"data",
"of",
"a",
"subsequence",
"of",
"the",
"given",
"byte",
"array"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L349-L357 |
163,695 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(ByteBuffer bb) {
Objects.requireNonNull(bb);
if (bb.remaining() == 0) {
return EMPTY;
}
byte[] data;
if (bb.hasArray()) {
data = Arrays.copyOfRange(bb.array(), bb.position() + bb.arrayOffset(),
bb.limit() + bb.arrayOffset());
} else {
data... | java | public static final Bytes of(ByteBuffer bb) {
Objects.requireNonNull(bb);
if (bb.remaining() == 0) {
return EMPTY;
}
byte[] data;
if (bb.hasArray()) {
data = Arrays.copyOfRange(bb.array(), bb.position() + bb.arrayOffset(),
bb.limit() + bb.arrayOffset());
} else {
data... | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"ByteBuffer",
"bb",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"bb",
")",
";",
"if",
"(",
"bb",
".",
"remaining",
"(",
")",
"==",
"0",
")",
"{",
"return",
"EMPTY",
";",
"}",
"byte",
"[",
"]",
... | Creates a Bytes object by copying the data of the given ByteBuffer.
@param bb Data will be read from this ByteBuffer in such a way that its position is not
changed. | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"data",
"of",
"the",
"given",
"ByteBuffer",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L365-L380 |
163,696 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(CharSequence cs) {
if (cs instanceof String) {
return of((String) cs);
}
Objects.requireNonNull(cs);
if (cs.length() == 0) {
return EMPTY;
}
ByteBuffer bb = StandardCharsets.UTF_8.encode(CharBuffer.wrap(cs));
if (bb.hasArray()) {
// this byte... | java | public static final Bytes of(CharSequence cs) {
if (cs instanceof String) {
return of((String) cs);
}
Objects.requireNonNull(cs);
if (cs.length() == 0) {
return EMPTY;
}
ByteBuffer bb = StandardCharsets.UTF_8.encode(CharBuffer.wrap(cs));
if (bb.hasArray()) {
// this byte... | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"CharSequence",
"cs",
")",
"{",
"if",
"(",
"cs",
"instanceof",
"String",
")",
"{",
"return",
"of",
"(",
"(",
"String",
")",
"cs",
")",
";",
"}",
"Objects",
".",
"requireNonNull",
"(",
"cs",
")",
";",
... | Creates a Bytes object by copying the data of the CharSequence and encoding it using UTF-8. | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"data",
"of",
"the",
"CharSequence",
"and",
"encoding",
"it",
"using",
"UTF",
"-",
"8",
"."
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L385-L405 |
163,697 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(String s) {
Objects.requireNonNull(s);
if (s.isEmpty()) {
return EMPTY;
}
byte[] data = s.getBytes(StandardCharsets.UTF_8);
return new Bytes(data, s);
} | java | public static final Bytes of(String s) {
Objects.requireNonNull(s);
if (s.isEmpty()) {
return EMPTY;
}
byte[] data = s.getBytes(StandardCharsets.UTF_8);
return new Bytes(data, s);
} | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"String",
"s",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"s",
")",
";",
"if",
"(",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"EMPTY",
";",
"}",
"byte",
"[",
"]",
"data",
"=",
"s",
... | Creates a Bytes object by copying the value of the given String | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"value",
"of",
"the",
"given",
"String"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L410-L417 |
163,698 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.of | public static final Bytes of(String s, Charset c) {
Objects.requireNonNull(s);
Objects.requireNonNull(c);
if (s.isEmpty()) {
return EMPTY;
}
byte[] data = s.getBytes(c);
return new Bytes(data);
} | java | public static final Bytes of(String s, Charset c) {
Objects.requireNonNull(s);
Objects.requireNonNull(c);
if (s.isEmpty()) {
return EMPTY;
}
byte[] data = s.getBytes(c);
return new Bytes(data);
} | [
"public",
"static",
"final",
"Bytes",
"of",
"(",
"String",
"s",
",",
"Charset",
"c",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"s",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"c",
")",
";",
"if",
"(",
"s",
".",
"isEmpty",
"(",
")",
")"... | Creates a Bytes object by copying the value of the given String with a given charset | [
"Creates",
"a",
"Bytes",
"object",
"by",
"copying",
"the",
"value",
"of",
"the",
"given",
"String",
"with",
"a",
"given",
"charset"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L422-L430 |
163,699 | apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.startsWith | public boolean startsWith(Bytes prefix) {
Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter");
if (prefix.length > this.length) {
return false;
} else {
int end = this.offset + prefix.length;
for (int i = this.offset, j = prefix.offset; i < end; i++, j++) ... | java | public boolean startsWith(Bytes prefix) {
Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter");
if (prefix.length > this.length) {
return false;
} else {
int end = this.offset + prefix.length;
for (int i = this.offset, j = prefix.offset; i < end; i++, j++) ... | [
"public",
"boolean",
"startsWith",
"(",
"Bytes",
"prefix",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"prefix",
",",
"\"startWith(Bytes prefix) cannot have null parameter\"",
")",
";",
"if",
"(",
"prefix",
".",
"length",
">",
"this",
".",
"length",
")",
"{... | Checks if this has the passed prefix
@param prefix is a Bytes object to compare to this
@return true or false
@since 1.1.0 | [
"Checks",
"if",
"this",
"has",
"the",
"passed",
"prefix"
] | 8e06204d4167651e2d3b5219b8c1397644e6ba6e | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L439-L453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.