public abstract class BoxItem extends BoxResource
Modifier and Type | Class and Description |
---|---|
class |
BoxItem.Info
Contains information about a BoxItem.
|
Modifier and Type | Field and Description |
---|---|
static String[] |
ALL_FIELDS
An array of all possible file fields that can be requested when calling
getInfo(String...) . |
static URLTemplate |
SHARED_ITEM_URL_TEMPLATE
Shared Item URL Template.
|
static URLTemplate |
WATERMARK_URL_TEMPLATE
Url template for operations with watermarks.
|
Constructor and Description |
---|
BoxItem(BoxAPIConnection api,
String id)
Constructs a BoxItem for an item with a given ID.
|
Modifier and Type | Method and Description |
---|---|
protected BoxWatermark |
applyWatermark(URLTemplate itemUrl,
String imprint)
Used to apply or update the watermark for the item.
|
abstract BoxItem.Info |
copy(BoxFolder destination)
Copies this item to another folder.
|
abstract BoxItem.Info |
copy(BoxFolder destination,
String newName)
Copies this item to another folder and gives it a new name.
|
abstract BoxItem.Info |
getInfo(String... fields)
Gets information about this item that's limited to a list of specified fields.
|
protected URL |
getItemURL() |
static BoxItem.Info |
getSharedItem(BoxAPIConnection api,
String sharedLink)
Gets an item that was shared with a shared link.
|
static BoxItem.Info |
getSharedItem(BoxAPIConnection api,
String sharedLink,
String password)
Gets an item that was shared with a password-protected shared link.
|
protected BoxWatermark |
getWatermark(URLTemplate itemUrl,
String... fields)
Used to retrieve the watermark for the item.
|
abstract BoxItem.Info |
move(BoxFolder destination)
Moves this item to another folder.
|
abstract BoxItem.Info |
move(BoxFolder destination,
String newName)
Moves this item to another folder and gives it a new name.
|
protected void |
removeWatermark(URLTemplate itemUrl)
Removes a watermark from the item.
|
abstract BoxItem.Info |
setCollections(BoxCollection... collections)
Sets the collections that this item belongs to.
|
equals, getAPI, getID, getResourceType, hashCode
public static final String[] ALL_FIELDS
getInfo(String...)
.public static final URLTemplate SHARED_ITEM_URL_TEMPLATE
public static final URLTemplate WATERMARK_URL_TEMPLATE
public BoxItem(BoxAPIConnection api, String id)
api
- the API connection to be used by the item.id
- the ID of the item.public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink)
api
- the API connection to be used by the shared item.sharedLink
- the shared link to the item.public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password)
api
- the API connection to be used by the shared item.sharedLink
- the shared link to the item.password
- the password for the shared link.protected URL getItemURL()
protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields)
itemUrl
- url template for the item.fields
- the fields to retrieve.protected BoxWatermark applyWatermark(URLTemplate itemUrl, String imprint)
itemUrl
- url template for the item.imprint
- the value must be "default", as custom watermarks is not yet supported.protected void removeWatermark(URLTemplate itemUrl)
itemUrl
- url template for the item.public abstract BoxItem.Info copy(BoxFolder destination)
destination
- the destination folder.public abstract BoxItem.Info copy(BoxFolder destination, String newName)
destination
- the destination folder.newName
- a new name for the copied item.public abstract BoxItem.Info move(BoxFolder destination)
destination
- the destination folder.public abstract BoxItem.Info move(BoxFolder destination, String newName)
destination
- the destination folder.newName
- a new name for the moved item.public abstract BoxItem.Info getInfo(String... fields)
fields
- the fields to retrieve.public abstract BoxItem.Info setCollections(BoxCollection... collections)
collections
- the collections that this item should belong to.