Class AttachmentFileControl

java.lang.Object
com.atlassian.jira.testkit.client.RestApiClient<T>
com.atlassian.jira.testkit.client.BackdoorControl<T>
com.atlassian.jira.functest.framework.backdoor.BackdoorControl<AttachmentFileControl>
com.atlassian.jira.functest.framework.backdoor.AttachmentFileControl

public class AttachmentFileControl extends BackdoorControl<AttachmentFileControl>
Backdoor control for operations on attachments e.g. creating, deleting, enabling, etc.
Since:
9.11
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.atlassian.jira.testkit.client.RestApiClient

    com.atlassian.jira.testkit.client.RestApiClient.BackdoorLoggingFilter, com.atlassian.jira.testkit.client.RestApiClient.JsonMediaTypeFilter, com.atlassian.jira.testkit.client.RestApiClient.RestCall
  • Field Summary

    Fields inherited from class com.atlassian.jira.testkit.client.BackdoorControl

    API_REST_PATH, API_REST_VERSION, DEFAULT_REST_PATH, logger, rootPath

    Fields inherited from class com.atlassian.jira.testkit.client.RestApiClient

    REST_VERSION
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Delete all attachment data from the instance.
    void
    Copy attachments from the local source path to the attachment path.
    void
     
    void
    Disable attachments.
    void
    Enable attachments.
    exists(String target)
    Check if an attachment or path exists on the instance.
    Gets the temporary attachment directory on the instance node.
    Check if attachments are stored in the shared home.

    Methods inherited from class com.atlassian.jira.functest.framework.backdoor.BackdoorControl

    createResource

    Methods inherited from class com.atlassian.jira.testkit.client.BackdoorControl

    createResourceForPath, createResourceForPath, get, getRestModulePath

    Methods inherited from class com.atlassian.jira.testkit.client.RestApiClient

    anonymous, authenticate, authoriseWithOAuth2, authoriseWithOAuth2, cleanUp, client, createResource, createResourceGadget, createResourceInternal, errorResponse, expanded, getCredentialsProvider, getEnvironmentData, loginAs, loginAs, registerResponse, resourceRoot, resourceRoot, setOf, toResponse, toResponse, toResponse, withCredentialsProvider

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AttachmentFileControl

      public AttachmentFileControl(JIRAEnvironmentData jiraEnvironmentData)
  • Method Details

    • enable

      public void enable()
      Enable attachments. This will also enable thumbnails and zip support.
      Since:
      10.0
    • disable

      public void disable()
      Disable attachments. This will also disable thumbnails and zip support.
      Since:
      10.0
    • copyAttachments

      public void copyAttachments(String source)
      Copy attachments from the local source path to the attachment path. This will work if attachments are stored in the shared home or in an S3 file store.
      Parameters:
      source - the absolute path to a local directory containing attachments to be copied to the instance attachment path.
      Since:
      9.11
    • cleanAttachments

      public void cleanAttachments()
      Delete all attachment data from the instance. This will only delete the underlying files, not the database records.
      Since:
      9.11
    • createAttachment

      public void createAttachment(String target, String body)
    • exists

      public Boolean exists(String target)
      Check if an attachment or path exists on the instance.
      Parameters:
      target - a path to the attachment on the instance relative to the attachment root, e.g. "ABC/ABC-1/10010". If attachments are stored in the shared home then passing a directory path such as "ABC/ABC-1" will return true if the directory exists.
      Returns:
      true if the attachment or path exists on the instance and false otherwise.
      Since:
      9.11
    • isInSharedHome

      public Boolean isInSharedHome()
      Check if attachments are stored in the shared home.
      Returns:
      true if attachments are stored in the shared home and false otherwise (eg. stored in S3).
      Since:
      9.11
    • getTemporaryAttachmentDirectory

      public String getTemporaryAttachmentDirectory()
      Gets the temporary attachment directory on the instance node.
      Returns:
      the temporary attachment directory on the node.