Package com.amilesend.onedrive.resource
Class DriveItemFolderType
java.lang.Object
com.amilesend.onedrive.resource.DriveItemType
com.amilesend.onedrive.resource.DriveItemFolderType
- Direct Known Subclasses:
DriveFolder
,DrivePackage
Defines shared operations between drive folders and packages.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFolder
(String name) Creates a new folder with the givenname
under this folder.Gets the list of child drive files under this folder.Gets the list of child drive folders under this folder.Gets the list of child drive packages under this folder.List
<? extends DriveItemType> Gets the list of drive items (both folders and files) under this folder.move
(@NonNull DriveFolder destinationFolder, String newName) Moves this folder to the specifiedDriveFolder
along with the new file name.move
(DriveFolder destinationFolder) Moves this folder to the specifiedDriveFolder
.Moves this folder to the specifiednewParentId
(i.e., represents a new DriveFolder's ID) along with the new folder name.List
<? extends DriveItemType> Searches this folder for the given query (e.g., file name).update()
Updates the attributes for this folder.Deprecated.Deprecated.useupload(Path, TransferProgressCallback)
insteadUploads the givenfile
under this folder.Uploads the givenfile
under this folder and reports transfer progress to the specifiedTransferProgressCallback
.uploadAsync
(File file) Deprecated.useuploadAsync(Path)
insteaduploadAsync
(File file, com.amilesend.client.connection.file.TransferProgressCallback callback) Deprecated.useuploadAsync(Path, TransferProgressCallback)
insteaduploadAsync
(Path filePath) Uploads the givenfile
asynchronously under this folder.uploadAsync
(Path filePath, com.amilesend.client.connection.file.TransferProgressCallback callback) Uploads the givenfile
asynchronously under this folder and reports transfer progress to the specifiedTransferProgressCallback
.Methods inherited from class com.amilesend.onedrive.resource.DriveItemType
addPermission, copy, copy, copy, copy, createSharingLink, delete, equals, getActivities, getCreatedBy, getCreatedDateTime, getETag, getFileSystemInfo, getId, getLastModifiedBy, getLastModifiedDateTime, getName, getPackage, getParentReference, getPermissions, getRemoteItem, getThumbnails, getVersions, hashCode, isDeleted, isFile, isFolder, isPackage, isRemote, setFileSystemInfo
-
Constructor Details
-
DriveItemFolderType
- Parameters:
delegate
- the drive item to wrap
-
-
Method Details
-
upload
Deprecated.useupload(Path)
insteadUploads the givenfile
under this folder.- Parameters:
file
- the file to upload- Returns:
- the drive file that represents the uploaded file
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
upload
Uploads the givenfile
under this folder.- Parameters:
filePath
- the file to upload- Returns:
- the drive file that represents the uploaded file
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
upload
@Deprecated public DriveFile upload(File file, com.amilesend.client.connection.file.TransferProgressCallback callback) throws IOException Deprecated.useupload(Path, TransferProgressCallback)
insteadUploads the givenfile
under this folder and reports transfer progress to the specifiedTransferProgressCallback
.- Parameters:
file
- the file to uploadcallback
- the callback be notified of transfer progress- Returns:
- the drive file that represents the uploaded file
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
upload
public DriveFile upload(Path filePath, com.amilesend.client.connection.file.TransferProgressCallback callback) throws IOException Uploads the givenfile
under this folder and reports transfer progress to the specifiedTransferProgressCallback
.- Parameters:
filePath
- the file to uploadcallback
- the callback be notified of transfer progress- Returns:
- the drive file that represents the uploaded file
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
uploadAsync
Deprecated.useuploadAsync(Path)
insteadUploads the givenfile
asynchronously under this folder.- Parameters:
file
- the file to upload- Returns:
- the async execution used to obtain the drive file once it has completed
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
uploadAsync
Uploads the givenfile
asynchronously under this folder.- Parameters:
filePath
- the file to upload- Returns:
- the async execution used to obtain the drive file once it has completed
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
uploadAsync
@Deprecated public DriveFileUploadExecution uploadAsync(File file, com.amilesend.client.connection.file.TransferProgressCallback callback) throws IOException Deprecated.useuploadAsync(Path, TransferProgressCallback)
insteadUploads the givenfile
asynchronously under this folder and reports transfer progress to the specifiedTransferProgressCallback
.- Parameters:
file
- the file to uploadcallback
- the callback be notified of transfer progress- Returns:
- the async execution used to obtain the drive file once it has completed
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
uploadAsync
public DriveFileUploadExecution uploadAsync(Path filePath, com.amilesend.client.connection.file.TransferProgressCallback callback) throws IOException Uploads the givenfile
asynchronously under this folder and reports transfer progress to the specifiedTransferProgressCallback
.- Parameters:
filePath
- the file to uploadcallback
- the callback be notified of transfer progress- Returns:
- the async execution used to obtain the drive file once it has completed
- Throws:
IOException
- if an error occurred while uploading the file- See Also:
-
createFolder
Creates a new folder with the givenname
under this folder.- Parameters:
name
- the name of the new folder- Returns:
- the new drive folder
-
getChildPackages
Gets the list of child drive packages under this folder.- Returns:
- the list of drive packages
-
getChildFolders
Gets the list of child drive folders under this folder.- Returns:
- the list of drive folders
-
getChildFiles
Gets the list of child drive files under this folder.- Returns:
- the list of drive files
-
getChildren
Gets the list of drive items (both folders and files) under this folder.- Returns:
- the list of drive items
- See Also:
-
search
Searches this folder for the given query (e.g., file name).- Parameters:
query
- the search query- Returns:
- the list of drive item types (either a DriveFolder or DriveFile).
- See Also:
-
update
Updates the attributes for this folder.- Returns:
- the updated drive folder
-
move
Moves this folder to the specifiedDriveFolder
.- Parameters:
destinationFolder
- the destination drive folder- Returns:
- the updated drive file that represents this moved file
-
move
Moves this folder to the specifiedDriveFolder
along with the new file name.- Parameters:
destinationFolder
- the destination drive foldernewName
- the new name of the file- Returns:
- the updated drive folder that represents this moved folder
-
move
Moves this folder to the specifiednewParentId
(i.e., represents a new DriveFolder's ID) along with the new folder name.- Parameters:
destinationParentId
- the new parent destination IDnewName
- the new name of the file- Returns:
- the updated drive folder that represents this moved folder
-
upload(Path)
instead