Interface FolderResources


  • public interface FolderResources

    This interface provides methods to access Folder resources.

    Thread Safety: Implementation of this interface must be thread safe.

    • Method Detail

      • getFolder

        @Deprecated(since="3.4.0",
                    forRemoval=true)
        Folder getFolder​(long folderId,
                         java.util.EnumSet<SourceInclusion> includes)
                  throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.

        Get a folder.

        It mirrors to the following Smartsheet REST API method: GET /folder/{id}

        Parameters:
        folderId - the folder id
        includes - 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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation
      • listFolders

        @Deprecated(since="3.4.0",
                    forRemoval=true)
        PagedResult<Folder> listFolders​(long parentFolderId,
                                        PaginationParameters parameters)
                                 throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.

        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 id
        parameters - 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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 id
        folder - the folder to create
        Returns:
        the created folder
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 id
        containerDestination - describes the destination container
        includes - optional parameters to include
        skipRemap - 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 id
        containerDestination - describes the destination container
        includes - optional parameters to include
        skipRemap - optional parameters to NOT re-map in the new folder
        excludes - 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 id
        containerDestination - describes the destination container
        Returns:
        the folder
        Throws:
        SmartsheetException - the smartsheet exception
      • getFolderMetadata

        Folder getFolderMetadata​(long folderId,
                                 java.util.EnumSet<GetFolderMetadataInclusion> includes)
                          throws SmartsheetException

        Get metadata of a folder.

        It mirrors to the following Smartsheet REST API method: GET /folders/{folderId}/metadata

        Parameters:
        folderId - the folder id
        includes - the include parameters (optional)
        Returns:
        the folder metadata (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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation
      • getFolderChildren

        TokenPaginatedResult<java.lang.Object> getFolderChildren​(long folderId,
                                                                 java.util.EnumSet<ChildrenResourceType> childrenResourceTypes,
                                                                 java.util.EnumSet<GetFolderChildrenInclusion> includes,
                                                                 java.lang.String lastKey,
                                                                 java.lang.Integer maxItems)
                                                          throws SmartsheetException

        Get children of a folder.

        It mirrors to the following Smartsheet REST API method: GET /folders/{folderId}/children

        Parameters:
        folderId - the folder id
        childrenResourceTypes - the resource type to filter by (optional)
        includes - the include parameters (optional)
        lastKey - the last key for pagination (optional)
        maxItems - the maximum number of items to return (optional)
        Returns:
        the paginated children response
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation