Interface FolderResources
-
public interface FolderResources
This interface provides methods to access Folder resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Folder
copyFolder(long folderId, ContainerDestination containerDestination, java.util.EnumSet<FolderCopyInclusion> includes, java.util.EnumSet<FolderRemapExclusion> skipRemap)
Creates a copy of the specified Folder.Folder
copyFolder(long folderId, ContainerDestination containerDestination, java.util.EnumSet<FolderCopyInclusion> includes, java.util.EnumSet<FolderRemapExclusion> skipRemap, java.util.EnumSet<CopyExclusion> excludes)
Creates a copy of the specified Folder.Folder
createFolder(long parentFolderId, Folder folder)
Create a folder.void
deleteFolder(long folderId)
Delete a folder.Folder
getFolder(long folderId, java.util.EnumSet<SourceInclusion> includes)
Get a folder.PagedResult<Folder>
listFolders(long parentFolderId, PaginationParameters parameters)
List child folders of a given folder.Folder
moveFolder(long folderId, ContainerDestination containerDestination)
Moves the specified Folder to another location.Folder
updateFolder(Folder folder)
Update a folder.
-
-
-
Method Detail
-
getFolder
Folder getFolder(long folderId, java.util.EnumSet<SourceInclusion> includes) throws SmartsheetException
Get a folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}
- Parameters:
folderId
- the folder idincludes
- the include parameters- Returns:
- the folder (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
updateFolder
Folder updateFolder(Folder folder) throws SmartsheetException
Update a folder.
- Parameters:
folder
- the folder to update- Returns:
- the updated folder (note that if there is no such folder, this method will throw Resource Not Found Exception rather than returning null).
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
deleteFolder
void deleteFolder(long folderId) throws SmartsheetException
Delete a folder.
It mirrors to the following Smartsheet REST API method: DELETE /folder{id}
- Parameters:
folderId
- the folder id- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
listFolders
PagedResult<Folder> listFolders(long parentFolderId, PaginationParameters parameters) throws SmartsheetException
List child folders of a given folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}/folders
- Parameters:
parentFolderId
- the parent folder idparameters
- the parameters for pagination- Returns:
- the child folders (note that an empty list will be returned if no child folder is found).
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
createFolder
Folder createFolder(long parentFolderId, Folder folder) throws SmartsheetException
Create a folder.
It mirrors to the following Smartsheet REST API method: POST /folder/{id}/folders
- Parameters:
parentFolderId
- the parent folder idfolder
- the folder to create- Returns:
- the created folder
- Throws:
java.lang.IllegalArgumentException
- if any argument is null or empty stringInvalidRequestException
- if there is any problem with the REST API requestAuthorizationException
- if there is any problem with the REST API authorization (access token)ResourceNotFoundException
- if the resource cannot be foundServiceUnavailableException
- if the REST API service is not available (possibly due to rate limiting)SmartsheetException
- if there is any other error during the operation
-
copyFolder
Folder copyFolder(long folderId, ContainerDestination containerDestination, java.util.EnumSet<FolderCopyInclusion> includes, java.util.EnumSet<FolderRemapExclusion> skipRemap) throws SmartsheetException
Creates a copy of the specified Folder.
It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/copy
Exceptions: IllegalArgumentException : if folder is null InvalidRequestException : if there is any problem with the REST API request AuthorizationException : if there is any problem with the REST API authorization(access token) ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation
- Parameters:
folderId
- the folder idcontainerDestination
- describes the destination containerincludes
- optional parameters to includeskipRemap
- optional parameters to exclude- Returns:
- the folder
- Throws:
SmartsheetException
- the smartsheet exception
-
copyFolder
Folder copyFolder(long folderId, ContainerDestination containerDestination, java.util.EnumSet<FolderCopyInclusion> includes, java.util.EnumSet<FolderRemapExclusion> skipRemap, java.util.EnumSet<CopyExclusion> excludes) throws SmartsheetException
Creates a copy of the specified Folder.
It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/copy
Exceptions: IllegalArgumentException : if folder is null InvalidRequestException : if there is any problem with the REST API request AuthorizationException : if there is any problem with the REST API authorization(access token) ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation
- Parameters:
folderId
- the folder idcontainerDestination
- describes the destination containerincludes
- optional parameters to includeskipRemap
- optional parameters to NOT re-map in the new folderexcludes
- optional parameters to exclude- Returns:
- the folder
- Throws:
SmartsheetException
- the smartsheet exception
-
moveFolder
Folder moveFolder(long folderId, ContainerDestination containerDestination) throws SmartsheetException
Moves the specified Folder to another location.
It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/move
Exceptions: IllegalArgumentException : if folder is null InvalidRequestException : if there is any problem with the REST API request AuthorizationException : if there is any problem with the REST API authorization(access token) ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation
- Parameters:
folderId
- the folder idcontainerDestination
- describes the destination container- Returns:
- the folder
- Throws:
SmartsheetException
- the smartsheet exception
-
-