Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/main/java/com/box/sdk/BoxFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class BoxFile extends BoxItem {
"description", "size", "path_collection", "created_at", "modified_at", "trashed_at", "purged_at",
"content_created_at", "content_modified_at", "created_by", "modified_by", "owned_by", "shared_link", "parent",
"item_status", "version_number", "comment_count", "permissions", "tags", "lock", "extension", "is_package",
"file_version", "collections"};
"file_version", "collections", "watermark_info"};

/**
* Used to specify what filetype to request for a file thumbnail.
Expand Down Expand Up @@ -791,6 +791,7 @@ public class Info extends BoxItem.Info {
private BoxFileVersion version;
private URL previewLink;
private BoxLock lock;
private boolean isWatermarked;

/**
* Constructs an empty Info object.
Expand Down Expand Up @@ -892,6 +893,14 @@ public URL getPreviewLink() {
return this.previewLink;
}

/**
* Gets flag indicating whether this file is Watermarked.
* @return whether the file is watermarked or not
*/
public boolean getIsWatermarked() {
return this.isWatermarked;
}

@Override
protected void parseJSONMember(JsonObject.Member member) {
super.parseJSONMember(member);
Expand Down Expand Up @@ -925,6 +934,9 @@ protected void parseJSONMember(JsonObject.Member member) {
} else {
this.lock = new BoxLock(value.asObject(), BoxFile.this.getAPI());
}
} else if (memberName.equals("watermark_info")) {
JsonObject jsonObject = value.asObject();
this.isWatermarked = jsonObject.get("is_watermarked").asBoolean();
}
}

Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/box/sdk/BoxFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class BoxFolder extends BoxItem implements Iterable<BoxItem.Info> {
"description", "size", "path_collection", "created_by", "modified_by", "trashed_at", "purged_at",
"content_created_at", "content_modified_at", "owned_by", "shared_link", "folder_upload_email", "parent",
"item_status", "item_collection", "sync_state", "has_collaborations", "permissions", "tags",
"can_non_owners_invite", "collections"};
"can_non_owners_invite", "collections", "watermark_info"};

private static final URLTemplate CREATE_FOLDER_URL = new URLTemplate("folders");
private static final URLTemplate CREATE_WEB_LINK_URL = new URLTemplate("web_links");
Expand Down Expand Up @@ -692,6 +692,7 @@ public class Info extends BoxItem.Info {
private SyncState syncState;
private EnumSet<Permission> permissions;
private boolean canNonOwnersInvite;
private boolean isWatermarked;

/**
* Constructs an empty Info object.
Expand Down Expand Up @@ -784,6 +785,14 @@ public boolean getCanNonOwnersInvite() {
return this.canNonOwnersInvite;
}

/**
* Gets flag indicating whether this file is Watermarked.
* @return whether the file is watermarked or not
*/
public boolean getIsWatermarked() {
return this.isWatermarked;
}

@Override
public BoxFolder getResource() {
return BoxFolder.this;
Expand Down Expand Up @@ -813,6 +822,9 @@ protected void parseJSONMember(JsonObject.Member member) {

} else if (memberName.equals("can_non_owners_invite")) {
this.canNonOwnersInvite = value.asBoolean();
} else if (memberName.equals("watermark_info")) {
JsonObject jsonObject = value.asObject();
this.isWatermarked = jsonObject.get("is_watermarked").asBoolean();
}
}

Expand Down