code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private void init()
{
style = new BoxStyle(UNIT);
textLine = new StringBuilder();
textMetrics = null;
graphicsPath = new Vector<PathSegment>();
startPage = 0;
endPage = Integer.MAX_VALUE;
fontTable = new FontTable();
} | java |
protected void updateFontTable()
{
PDResources resources = pdpage.getResources();
if (resources != null)
{
try
{
processFontResources(resources, fontTable);
} catch (IOException e) {
log.error("Error processing font resource... | java |
protected void finishBox()
{
if (textLine.length() > 0)
{
String s;
if (isReversed(Character.getDirectionality(textLine.charAt(0))))
s = textLine.reverse().toString();
else
s = textLine.toString();
curstyle.setLeft(textMetric... | java |
protected void updateStyle(BoxStyle bstyle, TextPosition text)
{
String font = text.getFont().getName();
String family = null;
String weight = null;
String fstyle = null;
bstyle.setFontSize(text.getFontSizeInPt());
bstyle.setLineHeight(text.getHeight());
if ... | java |
protected float transformLength(float w)
{
Matrix ctm = getGraphicsState().getCurrentTransformationMatrix();
Matrix m = new Matrix();
m.setValue(2, 0, w);
return m.multiply(ctm).getTranslateX();
} | java |
protected float[] transformPosition(float x, float y)
{
Point2D.Float point = super.transformedPoint(x, y);
AffineTransform pageTransform = createCurrentPageTransformation();
Point2D.Float transformedPoint = (Point2D.Float) pageTransform.transform(point, null);
return new float[]{(f... | java |
protected String stringValue(COSBase value)
{
if (value instanceof COSString)
return ((COSString) value).getString();
else if (value instanceof COSNumber)
return String.valueOf(((COSNumber) value).floatValue());
else
return "";
} | java |
protected String colorString(PDColor pdcolor)
{
String color = null;
try
{
float[] rgb = pdcolor.getColorSpace().toRGB(pdcolor.getComponents());
color = colorString(rgb[0], rgb[1], rgb[2]);
} catch (IOException e) {
log.error("colorString: IOExcept... | java |
@NonNull
public static File[] listAllFiles(File directory) {
if (directory == null) {
return new File[0];
}
File[] files = directory.listFiles();
return files != null ? files : new File[0];
} | java |
static boolean isOnClasspath(String className) {
boolean isOnClassPath = true;
try {
Class.forName(className);
} catch (ClassNotFoundException exception) {
isOnClassPath = false;
}
return isOnClassPath;
} | java |
@Nullable
public static LocationEngineResult extractResult(Intent intent) {
LocationEngineResult result = null;
if (isOnClasspath(GOOGLE_PLAY_LOCATION_RESULT)) {
result = extractGooglePlayResult(intent);
}
return result == null ? extractAndroidResult(intent) : result;
} | java |
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case REQUEST_PERMISSIONS_CODE:
if (listener != null) {
boolean granted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED;
liste... | java |
public static String retrieveVendorId() {
if (MapboxTelemetry.applicationContext == null) {
return updateVendorId();
}
SharedPreferences sharedPreferences = obtainSharedPreferences(MapboxTelemetry.applicationContext);
String mapboxVendorId = sharedPreferences.getString(MAPBOX_SHARED_PREFERENCE_KE... | java |
private static boolean getSystemConnectivity(Context context) {
try {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm == null) {
return false;
}
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNe... | java |
public static CrashReport fromJson(String json) throws IllegalArgumentException {
try {
return new CrashReport(json);
} catch (JSONException je) {
throw new IllegalArgumentException(je.toString());
}
} | java |
static boolean uninstall() {
boolean uninstalled = false;
synchronized (lock) {
if (locationCollectionClient != null) {
locationCollectionClient.locationEngineController.onDestroy();
locationCollectionClient.settingsChangeHandlerThread.quit();
locationCollectionClient.sharedPrefere... | java |
@Nullable public GeoTarget getCanonAncestor(GeoTarget.Type type) {
for (GeoTarget target = this; target != null; target = target.canonParent()) {
if (target.key.type == type) {
return target;
}
}
return null;
} | java |
public byte[] encrypt(byte[] plainData) {
checkArgument(plainData.length >= OVERHEAD_SIZE,
"Invalid plainData, %s bytes", plainData.length);
// workBytes := initVector || payload || zeros:4
byte[] workBytes = plainData.clone();
ByteBuffer workBuffer = ByteBuffer.wrap(workBytes);
boolean suc... | java |
public static BoxConfig readFrom(Reader reader) throws IOException {
JsonObject config = JsonObject.readFrom(reader);
JsonObject settings = (JsonObject) config.get("boxAppSettings");
String clientId = settings.get("clientID").asString();
String clientSecret = settings.get("clientSecret")... | java |
public static BoxCollaborationWhitelist.Info create(final BoxAPIConnection api, String domain,
WhitelistDirection direction) {
URL url = COLLABORATION_WHITELIST_ENTRIES_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequ... | java |
public void delete() {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_WHITELIST_ENTRY_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, HttpMethod.DELETE);
BoxAPIResponse response = request.send();
response.dis... | java |
public static <T_Result, T_Source> List<T_Result> map(Collection<T_Source> source,
Mapper<T_Result, T_Source> mapper) {
List<T_Result> result = new LinkedList<T_Result>();
for (T_Source element : source) {
result.add(mapper.map(element));
}
return result;
} | java |
public BoxFolder.Info createFolder(String name) {
JsonObject parent = new JsonObject();
parent.add("id", this.getID());
JsonObject newFolder = new JsonObject();
newFolder.add("name", name);
newFolder.add("parent", parent);
BoxJSONRequest request = new BoxJSONRequest(thi... | java |
public void rename(String newName) {
URL url = FOLDER_INFO_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
JsonObject updateInfo = new JsonObject();
updateInfo.add("name", newName);
request.se... | java |
public BoxFile.Info uploadFile(InputStream fileContent, String name, long fileSize, ProgressListener listener) {
FileUploadParams uploadInfo = new FileUploadParams()
.setContent(fileContent)
.setName(name)
.setSize(fileSize)
.setProgressListener(li... | java |
public BoxFile.Info uploadFile(FileUploadParams uploadParams) {
URL uploadURL = UPLOAD_FILE_URL.build(this.getAPI().getBaseUploadURL());
BoxMultipartRequest request = new BoxMultipartRequest(getAPI(), uploadURL);
JsonObject fieldJSON = new JsonObject();
JsonObject parentIdJSON = new Jso... | java |
public Iterable<BoxItem.Info> getChildren(final String... fields) {
return new Iterable<BoxItem.Info>() {
@Override
public Iterator<BoxItem.Info> iterator() {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
URL url =... | java |
public Iterable<BoxItem.Info> getChildren(String sort, SortDirection direction, final String... fields) {
QueryStringBuilder builder = new QueryStringBuilder()
.appendParam("sort", sort)
.appendParam("direction", direction.toString());
if (fields.length > 0) {
... | java |
public PartialCollection<BoxItem.Info> getChildrenRange(long offset, long limit, String... fields) {
QueryStringBuilder builder = new QueryStringBuilder()
.appendParam("limit", limit)
.appendParam("offset", offset);
if (fields.length > 0) {
builder.appendPara... | java |
@Override
public Iterator<BoxItem.Info> iterator() {
URL url = GET_ITEMS_URL.build(this.getAPI().getBaseURL(), BoxFolder.this.getID());
return new BoxItemIterator(BoxFolder.this.getAPI(), url);
} | java |
public Metadata createMetadata(String templateName, Metadata metadata) {
String scope = Metadata.scopeBasedOnType(templateName);
return this.createMetadata(templateName, scope, metadata);
} | java |
public Metadata createMetadata(String templateName, String scope, Metadata metadata) {
URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName);
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "POST");
request.addHeader("Content-Type", "a... | java |
public Metadata setMetadata(String templateName, String scope, Metadata metadata) {
Metadata metadataValue = null;
try {
metadataValue = this.createMetadata(templateName, scope, metadata);
} catch (BoxAPIException e) {
if (e.getResponseCode() == 409) {
Me... | java |
public Metadata getMetadata(String templateName) {
String scope = Metadata.scopeBasedOnType(templateName);
return this.getMetadata(templateName, scope);
} | java |
public void deleteMetadata(String templateName) {
String scope = Metadata.scopeBasedOnType(templateName);
this.deleteMetadata(templateName, scope);
} | java |
public void deleteMetadata(String templateName, String scope) {
URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName);
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse response = request.send();
respons... | java |
public String addClassification(String classificationType) {
Metadata metadata = new Metadata().add(Metadata.CLASSIFICATION_KEY, classificationType);
Metadata classification = this.createMetadata(Metadata.CLASSIFICATION_TEMPLATE_KEY,
"enterprise", metadata);
return classificatio... | java |
public BoxFile.Info uploadLargeFile(InputStream inputStream, String fileName, long fileSize)
throws InterruptedException, IOException {
URL url = UPLOAD_SESSION_URL_TEMPLATE.build(this.getAPI().getBaseUploadURL());
return new LargeFileUpload().
upload(this.getAPI(), this.getI... | java |
public Iterable<BoxMetadataCascadePolicy.Info> getMetadataCascadePolicies(String... fields) {
Iterable<BoxMetadataCascadePolicy.Info> cascadePoliciesInfo =
BoxMetadataCascadePolicy.getAll(this.getAPI(), this.getID(), fields);
return cascadePoliciesInfo;
} | java |
public static BoxRetentionPolicy.Info createIndefinitePolicy(BoxAPIConnection api, String name) {
return createRetentionPolicy(api, name, TYPE_INDEFINITE, 0, ACTION_REMOVE_RETENTION);
} | java |
public static BoxRetentionPolicy.Info createFinitePolicy(BoxAPIConnection api, String name, int length,
String action, RetentionPolicyParams optionalParams) {
return createRetentionPolicy(api, name, TYPE_FINITE, length, action, optionalParams);
... | java |
private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action) {
return createRetentionPolicy(api, name, type, length, action, null);
} | java |
private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action,
RetentionPolicyParams optionalParams) {
URL... | java |
public Iterable<BoxRetentionPolicyAssignment.Info> getFolderAssignments(int limit, String ... fields) {
return this.getAssignments(BoxRetentionPolicyAssignment.TYPE_FOLDER, limit, fields);
} | java |
public Iterable<BoxRetentionPolicyAssignment.Info> getEnterpriseAssignments(int limit, String ... fields) {
return this.getAssignments(BoxRetentionPolicyAssignment.TYPE_ENTERPRISE, limit, fields);
} | java |
public Iterable<BoxRetentionPolicyAssignment.Info> getAllAssignments(int limit, String ... fields) {
return this.getAssignments(null, limit, fields);
} | java |
private Iterable<BoxRetentionPolicyAssignment.Info> getAssignments(String type, int limit, String ... fields) {
QueryStringBuilder queryString = new QueryStringBuilder();
if (type != null) {
queryString.appendParam("type", type);
}
if (fields.length > 0) {
q... | java |
public BoxRetentionPolicyAssignment.Info assignTo(BoxFolder folder) {
return BoxRetentionPolicyAssignment.createAssignmentToFolder(this.getAPI(), this.getID(), folder.getID());
} | java |
public BoxRetentionPolicyAssignment.Info assignToMetadataTemplate(String templateID,
MetadataFieldFilter... fieldFilters) {
return BoxRetentionPolicyAssignment.createAssignmentToMetadata(this.getAPI(), this.getID(), templateID,
... | java |
public static Iterable<BoxRetentionPolicy.Info> getAll(final BoxAPIConnection api, String ... fields) {
return getAll(null, null, null, DEFAULT_LIMIT, api, fields);
} | java |
public static Iterable<BoxRetentionPolicy.Info> getAll(
String name, String type, String userID, int limit, final BoxAPIConnection api, String ... fields) {
QueryStringBuilder queryString = new QueryStringBuilder();
if (name != null) {
queryString.appendParam("policy_name", n... | java |
public void start() {
if (this.started) {
throw new IllegalStateException("Cannot start the EventStream because it isn't stopped.");
}
final long initialPosition;
if (this.startingPosition == STREAM_POSITION_NOW) {
BoxAPIRequest request = new BoxAPIRequest(this.... | java |
protected boolean isDuplicate(String eventID) {
if (this.receivedEvents == null) {
this.receivedEvents = new LRUCache<String>();
}
return !this.receivedEvents.add(eventID);
} | java |
public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api,
String policyID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_ENTERPRISE), null);
} | java |
public static BoxRetentionPolicyAssignment.Info createAssignmentToFolder(BoxAPIConnection api, String policyID,
String folderID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_FOLDER).add("id", folderID), ... | java |
public static BoxRetentionPolicyAssignment.Info createAssignmentToMetadata(BoxAPIConnection api,
String policyID,
String templateID,
... | java |
private static BoxRetentionPolicyAssignment.Info createAssignment(BoxAPIConnection api, String policyID,
JsonObject assignTo, JsonArray filter) {
URL url = ASSIGNMENTS_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = ... | java |
public static Iterable<Metadata> getAllMetadata(BoxItem item, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new BoxResourceIterable<Metadata>(
item.getAPI(),... | java |
public Metadata add(String path, String value) {
this.values.add(this.pathToProperty(path), value);
this.addOp("add", path, value);
return this;
} | java |
public Metadata add(String path, List<String> values) {
JsonArray arr = new JsonArray();
for (String value : values) {
arr.add(value);
}
this.values.add(this.pathToProperty(path), arr);
this.addOp("add", path, arr);
return this;
} | java |
public Metadata replace(String path, String value) {
this.values.set(this.pathToProperty(path), value);
this.addOp("replace", path, value);
return this;
} | java |
public Metadata remove(String path) {
this.values.remove(this.pathToProperty(path));
this.addOp("remove", path, (String) null);
return this;
} | java |
@Deprecated
public String get(String path) {
final JsonValue value = this.values.get(this.pathToProperty(path));
if (value == null) {
return null;
}
if (!value.isString()) {
return value.toString();
}
return value.asString();
} | java |
public Date getDate(String path) throws ParseException {
return BoxDateFormat.parse(this.getValue(path).asString());
} | java |
public List<String> getMultiSelect(String path) {
List<String> values = new ArrayList<String>();
for (JsonValue val : this.getValue(path).asArray()) {
values.add(val.asString());
}
return values;
} | java |
public List<String> getPropertyPaths() {
List<String> result = new ArrayList<String>();
for (String property : this.values.names()) {
if (!property.startsWith("$")) {
result.add(this.propertyToPath(property));
}
}
return result;
} | java |
private String pathToProperty(String path) {
if (path == null || !path.startsWith("/")) {
throw new IllegalArgumentException("Path must be prefixed with a \"/\".");
}
return path.substring(1);
} | java |
private void addOp(String op, String path, String value) {
if (this.operations == null) {
this.operations = new JsonArray();
}
this.operations.add(new JsonObject()
.add("op", op)
.add("path", path)
.add("value", value));
} | java |
protected static BoxCollaboration.Info create(BoxAPIConnection api, JsonObject accessibleBy, JsonObject item,
BoxCollaboration.Role role, Boolean notify, Boolean canViewPath) {
String queryString = "";
if (notify != null) {
queryString = ne... | java |
public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {
URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJSON ... | java |
public Info getInfo() {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonObjec... | java |
public void updateInfo(Info info) {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(api, url, "PUT");
request.setBody(info.getPendingChanges());
BoxAPIResponse boxAPIRes... | java |
public void delete() {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(api, url, "DELETE");
BoxAPIResponse response = request.send();
response.disconnect();
} | java |
public static BoxLegalHoldAssignment.Info create(BoxAPIConnection api,
String policyID, String resourceType, String resourceID) {
URL url = ASSIGNMENTS_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, "POST")... | java |
public void addCustomNotificationRecipient(String userID) {
BoxUser user = new BoxUser(null, userID);
this.customNotificationRecipients.add(user.new Info());
} | java |
public static Iterable<BoxCollection.Info> getAllCollections(final BoxAPIConnection api) {
return new Iterable<BoxCollection.Info>() {
public Iterator<BoxCollection.Info> iterator() {
URL url = GET_COLLECTIONS_URL_TEMPLATE.build(api.getBaseURL());
return new BoxCollec... | java |
public PartialCollection<BoxItem.Info> getItemsRange(long offset, long limit, String... fields) {
QueryStringBuilder builder = new QueryStringBuilder()
.appendParam("offset", offset)
.appendParam("limit", limit);
if (fields.length > 0) {
builder.appendParam("... | java |
@Override
public Iterator<BoxItem.Info> iterator() {
URL url = GET_COLLECTION_ITEMS_URL.build(this.getAPI().getBaseURL(), BoxCollection.this.getID());
return new BoxItemIterator(BoxCollection.this.getAPI(), url);
} | java |
public static BoxCollaborationWhitelistExemptTarget.Info create(final BoxAPIConnection api, String userID) {
URL url = COLLABORATION_WHITELIST_EXEMPT_TARGET_ENTRIES_URL_TEMPLATE.build(api.getBaseURL());
BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST);
JsonObject requestJSO... | java |
public BoxCollaborationWhitelistExemptTarget.Info getInfo() {
URL url = COLLABORATION_WHITELIST_EXEMPT_TARGET_ENTRY_URL_TEMPLATE.build(this.getAPI().getBaseURL(),
this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.GET);
BoxJSONResponse respons... | java |
public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(String enterpriseId, String clientId,
String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache) {
BoxDeveloperEditionAPIConnection connection = new BoxDeveloperEditionAPIConnection(ente... | java |
public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(BoxConfig boxConfig) {
BoxDeveloperEditionAPIConnection connection = getAppEnterpriseConnection(boxConfig.getEnterpriseId(),
boxConfig.getClientId(), boxConfig.getClientSecret(), boxConfig.getJWTEncryptionPreferences());
... | java |
public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, String clientId,
String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache) {
BoxDeveloperEditionAPIConnection connection = new BoxDeveloperEditionAPIConnection(userId,
... | java |
public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig) {
return getAppUserConnection(userId, boxConfig.getClientId(), boxConfig.getClientSecret(),
boxConfig.getJWTEncryptionPreferences());
} | java |
public void authenticate() {
URL url;
try {
url = new URL(this.getTokenURL());
} catch (MalformedURLException e) {
assert false : "An invalid token URL indicates a bug in the SDK.";
throw new RuntimeException("An invalid token URL indicates a bug in the SDK.",... | java |
public void refresh() {
this.getRefreshLock().writeLock().lock();
try {
this.authenticate();
} catch (BoxAPIException e) {
this.notifyError(e);
this.getRefreshLock().writeLock().unlock();
throw e;
}
this.notifyRefresh();
t... | java |
public BoxTask.Info addTask(BoxTask.Action action, String message, Date dueAt) {
JsonObject itemJSON = new JsonObject();
itemJSON.add("type", "file");
itemJSON.add("id", this.getID());
JsonObject requestJSON = new JsonObject();
requestJSON.add("item", itemJSON);
requestJ... | java |
public URL getDownloadURL() {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
request.setFollowRedirects(false);
BoxRedirectResponse response = (BoxRedirectResponse) request.send();
... | java |
public void downloadRange(OutputStream output, long rangeStart, long rangeEnd) {
this.downloadRange(output, rangeStart, rangeEnd, null);
} | java |
public void downloadRange(OutputStream output, long rangeStart, long rangeEnd, ProgressListener listener) {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
if (rangeEnd > 0) {
reques... | java |
public void rename(String newName) {
URL url = FILE_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
JsonObject updateInfo = new JsonObject();
updateInfo.add("name", newName);
request.setBody(u... | java |
public void getRepresentationContent(String representationHint, String assetPath, OutputStream output) {
List<Representation> reps = this.getInfoWithRepresentations(representationHint).getRepresentations();
if (reps.size() < 1) {
throw new BoxAPIException("No matching representations found"... | java |
public Collection<BoxFileVersion> getVersions() {
URL url = VERSIONS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject jsonObject = J... | java |
public boolean canUploadVersion(String name, long fileSize) {
URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "OPTIONS");
JsonObject preflightInfo = new JsonObject();
if (name != null) {
... | java |
public byte[] getThumbnail(ThumbnailFileType fileType, int minWidth, int minHeight, int maxWidth, int maxHeight) {
QueryStringBuilder builder = new QueryStringBuilder();
builder.appendParam("min_width", minWidth);
builder.appendParam("min_height", minHeight);
builder.appendParam("max_wid... | java |
public List<BoxComment.Info> getComments() {
URL url = GET_COMMENTS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJSON = J... | java |
public List<BoxTask.Info> getTasks(String... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields).toString();
}
URL url = GET_TASKS_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), builder.toStr... | java |
public Metadata createMetadata(String typeName, Metadata metadata) {
String scope = Metadata.scopeBasedOnType(typeName);
return this.createMetadata(typeName, scope, metadata);
} | java |
public String updateClassification(String classificationType) {
Metadata metadata = new Metadata("enterprise", Metadata.CLASSIFICATION_TEMPLATE_KEY);
metadata.add("/Box__Security__Classification__Key", classificationType);
Metadata classification = this.updateMetadata(metadata);
return ... | java |
public String setClassification(String classificationType) {
Metadata metadata = new Metadata().add(Metadata.CLASSIFICATION_KEY, classificationType);
Metadata classification = null;
try {
classification = this.createMetadata(Metadata.CLASSIFICATION_TEMPLATE_KEY, "enterprise", metada... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.