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() . |
Constructor and Description |
---|
BoxItem(BoxAPIConnection api,
String id)
Constructs a BoxItem for an item with a given ID.
|
Modifier and Type | Method and Description |
---|---|
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 BoxSharedLink |
createSharedLink(BoxSharedLink.Access access,
Date unshareDate,
BoxSharedLink.Permissions permissions)
Creates a new shared link for this item.
|
abstract BoxItem.Info |
getInfo()
Gets information about this item.
|
abstract BoxItem.Info |
getInfo(String... fields)
Gets information about this item that's limited to a list of specified fields.
|
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.
|
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.
|
equals, getAPI, getID, hashCode
public static final String[] ALL_FIELDS
getInfo()
.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.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 BoxSharedLink createSharedLink(BoxSharedLink.Access access, Date unshareDate, BoxSharedLink.Permissions permissions)
This method is a convenience method for manually creating a new shared link and applying it to this item with
BoxItem.Info.setSharedLink(com.box.sdk.BoxSharedLink)
. You may want to create the shared link manually so that it can be updated along with
other changes to the item's info in a single network request, giving a boost to performance.
access
- the access level of the shared link.unshareDate
- the date and time at which the link will expire. Can be null to create a non-expiring link.permissions
- the permissions of the shared link. Can be null to use the default permissions.public abstract BoxItem.Info getInfo()
public abstract BoxItem.Info getInfo(String... fields)
fields
- the fields to retrieve.