Class DriveItemType

java.lang.Object
com.amilesend.onedrive.resource.DriveItemType
Direct Known Subclasses:
DriveFile, DriveItemFolderType

public abstract class DriveItemType extends Object
Defines the base class that wraps a DriveItem for direct access by consumers of this SDK.
  • Constructor Details

    • DriveItemType

      public DriveItemType(@NonNull DriveItem delegate)
  • Method Details

    • getCreatedBy

      public IdentitySet getCreatedBy()
      Gets the identity set that indicates who created this drive item.
      Returns:
      the identity set
      See Also:
    • getCreatedDateTime

      public String getCreatedDateTime()
      Gets the timestamp (formatted as a string) that indicates when this drive item was created.
      Returns:
      the timestamp
    • getETag

      public String getETag()
      Gets the eTag associated with this item.
      Returns:
      the etag
    • getId

      public String getId()
      Gets the drive item identifier.
      Returns:
      the drive item identifier
    • getLastModifiedBy

      public IdentitySet getLastModifiedBy()
      Gets the identity set that indicates who made the last modification to this drive item.
      Returns:
      the identity set
      See Also:
    • getLastModifiedDateTime

      public String getLastModifiedDateTime()
      Gets the timestamp (formatted as a string) that indicates when this drive item was modified.
      Returns:
      the timestamp
    • getName

      public String getName()
      Gets the name of this drive item.
      Returns:
      the name
    • getParentReference

      public ItemReference getParentReference()
      Gets the parent reference of this drive item.
      Returns:
      the parent reference
      See Also:
    • isDeleted

      public boolean isDeleted()
      Describes if this drive item has been marked for deletion.
      Returns:
      true if marked for deletion; else, false
    • isRemote

      public boolean isRemote()
      Describes if this drive item represents a remote item from another drive.
      Returns:
      true if this item is a remote item; else, false
    • getRemoteItem

      public RemoteItem getRemoteItem()
      Gets the remote item information. Can be null.
      Returns:
      the remote item information
    • getActivities

      public List<ItemActivity> getActivities()
      Gets the list of activities associated with this drive item.
      Returns:
      the list of activities
      See Also:
    • getPermissions

      public List<Permission> getPermissions()
      Gets the list of permissions associated with this drive item.
      Returns:
      the list of permissions
      See Also:
    • getThumbnails

      public List<ThumbnailSet> getThumbnails()
      Gets the list thumbnails associated with this drive item.
      Returns:
      the list of thumbnail sets
      See Also:
    • getVersions

      public List<DriveItemVersion> getVersions()
      Gets the list of versions for this drive item.
      Returns:
      the list of versions
      See Also:
    • isFolder

      public boolean isFolder()
      Describes if this is a folder.
      Returns:
      true if this item is a folder; else, false
    • isFile

      public boolean isFile()
      Describes if this is a file.
      Returns:
      true if this item is a file; else, false
    • getFileSystemInfo

      public FileSystemInfo getFileSystemInfo()
      Gets the local file system information associated with this drive item.
      Returns:
      the file system information
      See Also:
    • setFileSystemInfo

      public void setFileSystemInfo(@NonNull FileSystemInfo fileSystemInfo)
      Sets the local file system information associated with this drive item.
      Parameters:
      fileSystemInfo - the file system information
      See Also:
    • isPackage

      public boolean isPackage()
      Describes if this is a package.
      Returns:
      true if this item is a package; else, false
    • getPackage

      public Package getPackage()
      Gets the package information associated with this drive item.
      Returns:
      the package information
    • addPermission

      public List<Permission> addPermission(AddPermissionRequest request)
      Adds a permission for the given request.
      Parameters:
      request - containing the recipients and roles to add
      Returns:
      the list of permissions
      See Also:
    • createSharingLink

      public Permission createSharingLink(CreateSharingLinkRequest request)
      Creates a sharing link for the given request.
      Parameters:
      request - the descriptor of the type of link to share
      Returns:
      the sharing permissions that includes the link
    • copy

      public AsyncJob copy(DriveFolder destinationFolder)
      Copies this drive item type to the specified DriveFolder.
      Parameters:
      destinationFolder - the destination drive folder
      Returns:
      the AsyncJob that can be used to poll for the remote asynchronous operation progress.
    • copy

      public AsyncJob copy(@NonNull DriveFolder destinationFolder, String newName)
      Copies this drive item type to the specified DriveFolder along with the new file name.
      Parameters:
      destinationFolder - the destination drive folder
      newName - the new name of the file
      Returns:
      the AsyncJob that can be used to poll for the remote asynchronous operation progress.
    • copy

      public AsyncJob copy(String newName)
      Copies this drive item type to the specified newName within the same folder.
      Parameters:
      newName - the new name of the file
      Returns:
      the AsyncJob that can be used to poll for the remote asynchronous operation progress.
    • copy

      public AsyncJob copy(String destinationParentId, String newName)
      Copies this drive item type to the specified newParentId (i.e., represents a new DriveFolder's ID) along with the new file name.
      Parameters:
      destinationParentId - the destination parent identifier
      newName - the new name of the file
      Returns:
      the AsyncJob that can be used to poll for the remote asynchronous operation progress.
    • delete

      public void delete()
      Mark this drive item type for deletion. This item will be accessible via the drive's recycle bin.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object