Interface CommentAttachmentResources


  • public interface CommentAttachmentResources

    This interface provides methods to access CommentAttachment resources.

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

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Attachment attachFile​(long sheetId, long commentId, java.io.File file, java.lang.String contentType)
      Attach a file to a comment.
      Attachment attachFile​(long sheetId, long commentId, java.io.InputStream inputStream, java.lang.String contentType, long contentLength, java.lang.String attachmentName)
      Attach file for simple upload.
      Attachment attachUrl​(long sheetId, long commentId, Attachment attachment)
      Attach a URL to a comment.
    • Method Detail

      • attachUrl

        Attachment attachUrl​(long sheetId,
                             long commentId,
                             Attachment attachment)
                      throws SmartsheetException

        Attach a URL to a comment.

        The URL can be a normal URL (attachmentType "URL"), a Google Drive URL (attachmentType "GOOGLE_DRIVE") or a Box.com URL (attachmentType "BOX_COM").

        It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/comments/{commentId}/attachments

        Parameters:
        sheetId - the sheet id
        commentId - the comment id
        attachment - the attachment object
        Returns:
        the created attachment
        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
      • attachFile

        Attachment attachFile​(long sheetId,
                              long commentId,
                              java.io.File file,
                              java.lang.String contentType)
                       throws java.io.FileNotFoundException,
                              SmartsheetException

        Attach a file to a comment.

        It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/comments/{commentId}/attachments

        Parameters:
        sheetId - the id of the sheet
        commentId - the id of the comment
        file - the file to attach
        contentType - the content type of the file
        Returns:
        the created attachment
        Throws:
        java.io.FileNotFoundException - the file not found exception
        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
      • attachFile

        Attachment attachFile​(long sheetId,
                              long commentId,
                              java.io.InputStream inputStream,
                              java.lang.String contentType,
                              long contentLength,
                              java.lang.String attachmentName)
                       throws SmartsheetException

        Attach file for simple upload.

        Parameters:
        sheetId - the sheet id
        commentId - the comment id
        inputStream - the attachment data inputStream
        contentType - the content type
        contentLength - the content length
        attachmentName - the name of the attachment
        Returns:
        the attachment
        Throws:
        SmartsheetException - the smartsheet exception