Class ReadOnlyAttachment

All Implemented Interfaces:
Searchable, Content, Addressable, ContentTypeAware, HasLinkWikiMarkup, Versioned, RelatableEntity, EditableLabelable, Labelable, Contained<ContentEntityObject>, ContentConvertible, SearchableAttachment, Spaced, Serializable, Cloneable, Comparable<ContentEntityObject>

@Deprecated(forRemoval=true) public class ReadOnlyAttachment extends Attachment
Deprecated, for removal: This API element is subject to removal in a future version.
since 9.1, use Attachment directly.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.atlassian.confluence.pages.Attachment

    Attachment.Type
  • Field Summary

    Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject

    INITIAL_VERSION

    Fields inherited from interface com.atlassian.confluence.content.Content

    UNSET
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    addCustomContent(CustomContentEntityObject customContentEntityObject)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a ContentPermission.
    void
    applyChildVersioningPolicy(@Nullable Versioned versionToPromote, Consumer<? super Versioned> dao)
    Deprecated, for removal: This API element is subject to removal in a future version.
    If Versioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType) specifies so, moves content from versionToPromote to this Versioned instance or makes no change.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove all data from the object that does not need to be saved by historical versions.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Will copy all detail information of an attachment including : - Content Properties - File Name - File Size - Content Type - And set version is 1
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Don't use it directly, use AttachmentManager.getAttachments(page) instead.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the path relative to Confluence's base URL to view the given attachment in the context of this content (for example, highlighted in the content's list of attachments).
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method that returns the String representation of the content.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the BodyContent object for this ContentEntityObject.
    getBodyContent(BodyType expectedBodyType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the BodyContent object for this ContentEntityObject or throws an UnsupportedOperationException if its body type is not the same as the supplied expectedBodyType.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return any comment associated with this attachment
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the ContentId for this entity object, if it implements ContentConvertible.
    getContentPermission(String permissionType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gives back the first content permission of a specific type.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Note, this method does not return ContentPermissions inherited from the Content's ancestry.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the contents of the attachment as an InputStream
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the hibernate field for content status, distinguishing only draft/deleted/current status.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the api layer enum for content status, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED.
    @NonNull String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the MIME content-type of this attachment.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the display title.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getDownloadPath(String attachmentPath, boolean addVersionInfo)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the download path of the attachment for a given attachmentPath prefix.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the download path without any version info.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the download path without any version info or API revision.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the ContentEntityObject that backs this piece of content.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the file extension of the attachment.
    @NonNull String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the filename of this attachment.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getGlobalLabels(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List the labels on this content that are global labels
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the number of labels that are associated with this object.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Retrieve the labels that are associated with this object.
    getLabelsForDisplay(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List the labels on this content that are visible to a particular user, and should be shown in a list of labels.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the latest, current version of this versioned object.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @NonNull String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Subclasses should implement this method, giving a String back so that the content can be alphabetically sorted in a mixed-type list of content-entities.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    An outgoing link is a link on this page to another confluence page.
    It could also link to a website URL
    These links are contained in the page content
    They are refreshed each time the page is updated (LinkManager.updateOutgoingLinks())
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get all the permissions that apply to this content.
    getPersonalLabels(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List the labels on this content that are personal labels for a particular user
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    When we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getTeamLabels(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List the labels on this content that are team labels for a particular user
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get trash date if this CEO has been added to the trash since Confluence 7.14.
    Deprecated, for removal: This API element is subject to removal in a future version.
    An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the version number of this version of the object.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the right VersionChildOwnerPolicy depending on the passed contentType.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getVisibleLabels(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    List the labels on this content that are visible to a particular user
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Does this content have "current" status? (non-trashed and non-draft)
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Is this object marked as somebody's favourite?
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicates whether this attachment is supposed to be strictly hidden from displaying and searching Hidden attachment is not indexable Hidden attachment manipulation will not trigger external notification events
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only the current version of a non-hidden attachment is indexable (until we can deal with old objects in search results) We also don't want to index attachments associated with drafts or global descriptions or hidden attachments
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicates whether this attachment is supposed to be hidden under normal circumstances.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Is this the first version of this object?
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    This object is persistent if the id is not 0.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determines whether the Attachment is a user's profile picture
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method removes the given ContentPermissionSet from this CEO and disconnects the set from its owner.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    restores content from the trash
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method that sets the content of this ContentEntityObject.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the BodyContent object for this ContentEntityObject.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setClock(com.atlassian.core.util.Clock clock)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Initialises the ContentProperties of this ContentEntityObject by performing a deep clone of the ContentEntityObject object's properties.
    void
    setContentStatus(String contentStatus)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the hibernate field for content status, distinguishing only draft/deleted/current status.
    void
    setContentType(@NonNull String contentType)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setCreationDate(Date creationDate)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setCreatorName(String creatorName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the username of the creator
    void
    setFileName(@NonNull String fileName)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setFileSize(long fileSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setFileStoreId(String fileStoreId)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setHidden(boolean hidden)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setId(long id)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setLastModificationDate(Date lastModificationDate)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setLastModifierName(String lastModifierName)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setMediaType(@NonNull String mediaType)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setMinorEdit(boolean minorEdit)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setOriginalVersion(Versioned originalVersion)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the current version of this object.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setShareId(String shareId)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setSpace(Space space)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setSynchronyRevision(String synchronyRevision)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setSynchronyRevisionSource(String synchronyRevisionSource)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setVersion(int version)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the version number of this version of the object.
    void
    setVersionComment(String versionComment)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    sharedAccessAllowed(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if this draft can be accessed by users other than the creator (shared access)
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if this draft can be accessed by users other than the creator (shared access)
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    places content in trash can
    boolean
    wasCreatedBy(com.atlassian.user.User user)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class com.atlassian.confluence.pages.Attachment

    getDescriptionForMimeType, getImageDetailsDTO, setImageDetailsDTO

    Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject

    setLabellings

    Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject

    getConfluenceRevision

    Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject

    getRealClass

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ReadOnlyAttachment

      public ReadOnlyAttachment(Attachment delegate)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getLabels

      public List<Label> getLabels()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Labelable
      Retrieve the labels that are associated with this object.
      Specified by:
      getLabels in interface Labelable
      Overrides:
      getLabels in class AbstractLabelableEntityObject
      Returns:
      a list of label instances.
    • getLabelCount

      public int getLabelCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Labelable
      Get the number of labels that are associated with this object.
      Specified by:
      getLabelCount in interface Labelable
      Overrides:
      getLabelCount in class AbstractLabelableEntityObject
      Returns:
      the number of labels associated with this object.
    • isFavourite

      public boolean isFavourite(ConfluenceUser user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Labelable
      Is this object marked as somebody's favourite?
      Specified by:
      isFavourite in interface Labelable
      Overrides:
      isFavourite in class AbstractLabelableEntityObject
      Parameters:
      user - the user who is being checked against. If user is null this method must always return false (anonymous users can not mark anything as a favourite, obviously)
      Returns:
      true if the labelable object is a 'favourite' of a given user, false otherwise
    • getVisibleLabels

      public List<Label> getVisibleLabels(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractLabelableEntityObject
      List the labels on this content that are visible to a particular user
      Overrides:
      getVisibleLabels in class AbstractLabelableEntityObject
      Parameters:
      user - the user
      Returns:
      the labels on this content visible to that user
    • getPersonalLabels

      public List<Label> getPersonalLabels(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractLabelableEntityObject
      List the labels on this content that are personal labels for a particular user
      Overrides:
      getPersonalLabels in class AbstractLabelableEntityObject
      Parameters:
      user - the user
      Returns:
      the personal labels on this content visible to the user
    • getGlobalLabels

      public List<Label> getGlobalLabels(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractLabelableEntityObject
      List the labels on this content that are global labels
      Overrides:
      getGlobalLabels in class AbstractLabelableEntityObject
      Parameters:
      user - the user
      Returns:
      the global labels on this content visible to the user
    • getTeamLabels

      public List<Label> getTeamLabels(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractLabelableEntityObject
      List the labels on this content that are team labels for a particular user
      Overrides:
      getTeamLabels in class AbstractLabelableEntityObject
      Parameters:
      user - the user
      Returns:
      the team labels on this content visible to the user
    • getLabelsForDisplay

      public List<Label> getLabelsForDisplay(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractLabelableEntityObject
      List the labels on this content that are visible to a particular user, and should be shown in a list of labels. This is like {code}getVisibleLabels{code} except that it also filters out special labels like favourites
      Overrides:
      getLabelsForDisplay in class AbstractLabelableEntityObject
      Parameters:
      user - the user
      Returns:
      the labels on this content visible to that user
    • getLabellings

      public List<Labelling> getLabellings()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getLabellings in interface EditableLabelable
      Overrides:
      getLabellings in class AbstractLabelableEntityObject
    • addLabelling

      public void addLabelling(Labelling content)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      addLabelling in interface EditableLabelable
      Overrides:
      addLabelling in class AbstractLabelableEntityObject
    • removeLabelling

      public void removeLabelling(Labelling labelling)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      removeLabelling in interface EditableLabelable
      Overrides:
      removeLabelling in class AbstractLabelableEntityObject
    • getVersion

      public int getVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Return the version number of this version of the object. Version numbers are integers in ascending chronological order from 1 (the first version). Clients must not assume if two versions x and y exist, that any integer versions between x and y also exist.
      Specified by:
      getVersion in interface Versioned
      Overrides:
      getVersion in class AbstractVersionedEntityObject
      Returns:
      the version number of this version of the object
    • setVersion

      public void setVersion(int version)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Set the version number of this version of the object. Only call this method if you are creating a new version.
      Specified by:
      setVersion in interface Versioned
      Overrides:
      setVersion in class AbstractVersionedEntityObject
      Parameters:
      version - the new version number for this version of the object.
    • isNew

      public boolean isNew()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Is this the first version of this object?
      Specified by:
      isNew in interface Versioned
      Overrides:
      isNew in class AbstractVersionedEntityObject
      Returns:
      true if this is the first version of this versioned object, false if it is a later version.
    • getLatestVersion

      public Versioned getLatestVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Get the latest, current version of this versioned object. If this object is the current version, return this object.

      Note that drafts are a special version of a ContentEntityObject so for drafts this method should return the ContentEntityObject the drafts points to if it exists and the draft itself otherwise.

      Specified by:
      getLatestVersion in interface Versioned
      Overrides:
      getLatestVersion in class AbstractVersionedEntityObject
      Returns:
      the current version of this object.
      See Also:
    • isLatestVersion

      public boolean isLatestVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isLatestVersion in interface Versioned
      Overrides:
      isLatestVersion in class AbstractVersionedEntityObject
      Returns:
      true if this is the latest (current) version of the object, false if it is an historical version.
    • getCreatorName

      public String getCreatorName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCreatorName in class ConfluenceEntityObject
      Returns:
      username of the creator, or null if created anonymously
    • getCreator

      public ConfluenceUser getCreator()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCreator in class ConfluenceEntityObject
    • setCreatorName

      public void setCreatorName(String creatorName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ConfluenceEntityObject
      Set the username of the creator
      Overrides:
      setCreatorName in class ConfluenceEntityObject
    • getLastModifierName

      public String getLastModifierName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLastModifierName in class ConfluenceEntityObject
      Returns:
      username of the last modifier, or null if none.
    • getLastModifier

      public ConfluenceUser getLastModifier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLastModifier in class ConfluenceEntityObject
    • setLastModifierName

      public void setLastModifierName(String lastModifierName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setLastModifierName in class ConfluenceEntityObject
    • setCreator

      public void setCreator(ConfluenceUser creator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setCreator in class ConfluenceEntityObject
    • setLastModifier

      public void setLastModifier(ConfluenceUser lastModifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setLastModifier in class ConfluenceEntityObject
    • isPersistent

      public boolean isPersistent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ConfluenceEntityObject
      This object is persistent if the id is not 0.
      Specified by:
      isPersistent in interface EditableLabelable
      Overrides:
      isPersistent in class ConfluenceEntityObject
      Returns:
      true if this instance is a persisted label.
    • getTypeEnum

      public ContentTypeEnum getTypeEnum()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getTypeEnum in class ContentEntityObject
    • getIdAsString

      public String getIdAsString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getIdAsString in class ContentEntityObject
    • getAttachmentUrlPath

      public String getAttachmentUrlPath(Attachment attachment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Gets the path relative to Confluence's base URL to view the given attachment in the context of this content (for example, highlighted in the content's list of attachments). Generally you will want to call Attachment.getUrlPath() instead of this method: if we ever implement view pages for individual attachments, that's the method that will be changed to point to them.

      The default implementation just returns the view page for this content.

      Overrides:
      getAttachmentUrlPath in class ContentEntityObject
      Parameters:
      attachment - one of this content's attachments
      Returns:
      the path relative to the base url to view the attachment in the context of this content.
    • getTitle

      public String getTitle()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getTitle in interface EditableLabelable
      Overrides:
      getTitle in class ContentEntityObject
    • setTitle

      public void setTitle(String title)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setTitle in class ContentEntityObject
    • getLowerTitle

      public String getLowerTitle()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLowerTitle in class ContentEntityObject
    • getDefaultBodyType

      public BodyType getDefaultBodyType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getDefaultBodyType in class ContentEntityObject
    • getBodyContent

      public BodyContent getBodyContent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Gets the BodyContent object for this ContentEntityObject. Although it appears that there may be a number of BodyContent objects attached to a ContentEntityObject, only one is ever used. If there are none currently attached, a new BodyContent object is created and returned. Any values set on the returned BodyContent will not be saved unless a call is made to ContentEntityObject.setBodyContent(com.atlassian.confluence.core.BodyContent). Null is never returned.

      This method should not normally be called directly unless, you need to be able to handle different body types. Use ContentEntityObject.getBodyAsString() as you should normally be expecting only one type.

      Overrides:
      getBodyContent in class ContentEntityObject
      Returns:
      the BodyContent.
      See Also:
    • getBodyContent

      public BodyContent getBodyContent(BodyType expectedBodyType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Gets the BodyContent object for this ContentEntityObject or throws an UnsupportedOperationException if its body type is not the same as the supplied expectedBodyType.

      This method should not normally be called directly unless, you need to be able to handle different body types. Use ContentEntityObject.getBodyAsString() and ContentEntityObject.getBodyAsString() as you should normally be expecting only one type.

      Overrides:
      getBodyContent in class ContentEntityObject
      Parameters:
      expectedBodyType - that can be handled by the caller.
      Returns:
      the BodyContent.
      See Also:
    • setBodyContent

      public void setBodyContent(BodyContent bodyContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Sets the BodyContent object for this ContentEntityObject.

      This method should not normally be called directly unless, you need to be able to handle different body types. Use ContentEntityObject.setBodyAsString(java.lang.String) as you should normally be expecting only one type.

      Overrides:
      setBodyContent in class ContentEntityObject
      Parameters:
      bodyContent - to be set. If the supplied bodyContent or its body are null, the list of body contents are cleared.
    • getBodyAsString

      public String getBodyAsString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Convenience method that returns the String representation of the content.
      Overrides:
      getBodyAsString in class ContentEntityObject
      Returns:
      the content.
    • setBodyAsString

      public void setBodyAsString(String content)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Convenience method that sets the content of this ContentEntityObject.
      Overrides:
      setBodyAsString in class ContentEntityObject
      Parameters:
      content - the String representation of the content.
    • getBodyContents

      public List<BodyContent> getBodyContents()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getBodyContents in class ContentEntityObject
    • setBodyContents

      public void setBodyContents(List<BodyContent> bodyContents)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setBodyContents in class ContentEntityObject
    • getOutgoingLinks

      public List<OutgoingLink> getOutgoingLinks()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      An outgoing link is a link on this page to another confluence page.
      It could also link to a website URL
      These links are contained in the page content
      They are refreshed each time the page is updated (LinkManager.updateOutgoingLinks())
      Overrides:
      getOutgoingLinks in class ContentEntityObject
      Returns:
      List of OutgoingLinks
    • setOutgoingLinks

      public void setOutgoingLinks(List<OutgoingLink> outgoingLinks)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setOutgoingLinks in class ContentEntityObject
    • addOutgoingLink

      public void addOutgoingLink(OutgoingLink link)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      addOutgoingLink in class ContentEntityObject
    • removeOutgoingLink

      public void removeOutgoingLink(OutgoingLink link)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      removeOutgoingLink in class ContentEntityObject
    • setOriginalVersion

      public void setOriginalVersion(Versioned originalVersion)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Set the current version of this object. After this method is called, this object will become an historical version of the object passed in.
      Specified by:
      setOriginalVersion in interface Versioned
      Overrides:
      setOriginalVersion in class ContentEntityObject
      Parameters:
      originalVersion - the current version of this object.
    • applyChildVersioningPolicy

      public void applyChildVersioningPolicy(@Nullable Versioned versionToPromote, Consumer<? super Versioned> dao)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      If Versioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType) specifies so, moves content from versionToPromote to this Versioned instance or makes no change.
      Specified by:
      applyChildVersioningPolicy in interface Versioned
      Overrides:
      applyChildVersioningPolicy in class ContentEntityObject
      Parameters:
      versionToPromote - the new version of the current instance that we're getting the children from
      dao - onRemove used to delete dangling contained content
    • getPermissions

      public List<ContentPermission> getPermissions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject

      Get all the permissions that apply to this content. Please do not modify the contents of this list!

      Overrides:
      getPermissions in class ContentEntityObject
      Returns:
      a list of all the permissions that apply to this content.
    • getContentPermission

      public ContentPermission getContentPermission(String permissionType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Gives back the first content permission of a specific type. Returns only the permission if it is set on this object and not inherited. Returns null if no permission can't be found.

      Synchronized, as otherwise it was creating timing issues during the multi-threaded re-indexing.

      Overrides:
      getContentPermission in class ContentEntityObject
      Returns:
      ContentPermission
    • sharedAccessAllowed

      public boolean sharedAccessAllowed(String shareId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Checks if this draft can be accessed by users other than the creator (shared access)

      IMPORTANT NOTE: if shared access is disallowed it prevails over permissions (only creator has access), BUT if it is allowed normal permissions still need to be checked

      Drafts for existing objects are considered automatically shared according to the permissions set, but drafts for new objects are considered private, so if a user if trying to access one of them it should be verified that is doing so with the proper share id in addition to permissions.

      Overrides:
      sharedAccessAllowed in class ContentEntityObject
      Parameters:
      shareId - Optional. Used to check for access if needed
      Returns:
      true if this draft can be accessed given a share id, false otherwise
      See Also:
    • getContentStatusObject

      public ContentStatus getContentStatusObject()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Get the api layer enum for content status, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED.

      Important: this has different semantics from the hibernate field ContentEntityObject.getContentStatus(), because it takes into account historical status, and uses different strings for some values.

      Overrides:
      getContentStatusObject in class ContentEntityObject
      Returns:
      the API ContentStatus for this content, distinguishing CURRENT/HISTORICAL/DRAFT/TRASHED
      See Also:
    • getContentStatus

      public String getContentStatus()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Get the hibernate field for content status, distinguishing only draft/deleted/current status.

      Important: this is not the same as the string value of the api ContentEntityObject.getContentStatusObject(), because that one takes into account historical status, and uses different strings for some values.

      This method does NOT distinguish current and historical versions. Both will return "current". See AbstractVersionedEntityObject.isLatestVersion() to distinguish them.

      Overrides:
      getContentStatus in class ContentEntityObject
      Returns:
      the hibernate field value, distinguishing only ContentEntityObject.CURRENT, ContentEntityObject.DRAFT, ContentEntityObject.DELETED.
      See Also:
    • setContentStatus

      public void setContentStatus(String contentStatus)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Set the hibernate field for content status, distinguishing only draft/deleted/current status.

      Important: this is not the same as the string value of the api ContentEntityObject.getContentStatusObject(), because that one takes into account historical status, and uses different strings for some values.

      This method does NOT distinguish current and historical versions. Both use "current". See AbstractVersionedEntityObject.isLatestVersion() to distinguish them.

      Overrides:
      setContentStatus in class ContentEntityObject
      Parameters:
      contentStatus - the hibernate field value, ContentEntityObject.CURRENT, ContentEntityObject.DRAFT, ContentEntityObject.DELETED.
      See Also:
    • isCurrent

      public boolean isCurrent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Does this content have "current" status? (non-trashed and non-draft)

      This method does NOT distinguish current and historical versions. Both will return true. See AbstractVersionedEntityObject.isLatestVersion() to distinguish them.

      Overrides:
      isCurrent in class ContentEntityObject
      Returns:
      true if the content is live, i.e. not trashed and not a draft
      See Also:
    • isDeleted

      public boolean isDeleted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      isDeleted in class ContentEntityObject
    • isDraft

      public boolean isDraft()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      isDraft in class ContentEntityObject
    • sharedAccessAllowed

      public boolean sharedAccessAllowed(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Checks if this draft can be accessed by users other than the creator (shared access)

      IMPORTANT NOTE: if shared access is disallowed it prevails over permissions (only creator has access), BUT if it is allowed normal permissions still need to be checked

      Drafts for existing objects are considered automatically shared according to the permissions set, but drafts that have never been published are considered private even without permissions set, so if a user if trying to access one of them it should be verified that is doing so with the proper share id in addition to permissions.

      Overrides:
      sharedAccessAllowed in class ContentEntityObject
      Parameters:
      user - User to check
      Returns:
      true if this draft can be accessed given a share id, false otherwise
      See Also:
    • getShareId

      public String getShareId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getShareId in class ContentEntityObject
      See Also:
    • setShareId

      public void setShareId(String shareId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setShareId in class ContentEntityObject
      See Also:
    • getSynchronyRevision

      public String getSynchronyRevision()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getSynchronyRevision in class ContentEntityObject
      See Also:
    • setSynchronyRevision

      public void setSynchronyRevision(String synchronyRevision)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setSynchronyRevision in class ContentEntityObject
      See Also:
    • getSynchronyRevisionSource

      public String getSynchronyRevisionSource()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getSynchronyRevisionSource in class ContentEntityObject
      See Also:
    • getTrashDate

      public Optional<Instant> getTrashDate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Get trash date if this CEO has been added to the trash since Confluence 7.14. For generic cases, use TrashManagerInternal#findTrashDate
      Overrides:
      getTrashDate in class ContentEntityObject
      Returns:
      when this content entity was added to the trash or Optional.empty() if it was trashed before 7.14
    • setSynchronyRevisionSource

      public void setSynchronyRevisionSource(String synchronyRevisionSource)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setSynchronyRevisionSource in class ContentEntityObject
      See Also:
    • getCollaborativeEditingUuid

      public String getCollaborativeEditingUuid()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCollaborativeEditingUuid in class ContentEntityObject
      See Also:
    • setCollaborativeEditingUuid

      public void setCollaborativeEditingUuid(String uuid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setCollaborativeEditingUuid in class ContentEntityObject
      See Also:
    • isUnpublished

      public boolean isUnpublished()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      isUnpublished in class ContentEntityObject
    • wasCreatedBy

      public boolean wasCreatedBy(com.atlassian.user.User user)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      wasCreatedBy in class ContentEntityObject
    • trash

      public void trash()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      places content in trash can
      Overrides:
      trash in class ContentEntityObject
    • restore

      public void restore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      restores content from the trash
      Overrides:
      restore in class ContentEntityObject
    • getAttachments

      public List<Attachment> getAttachments()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject

      Don't use it directly, use AttachmentManager.getAttachments(page) instead.

      This also includes trashed items.

      Overrides:
      getAttachments in class ContentEntityObject
    • getLatestVersionsOfAttachments

      public List<Attachment> getLatestVersionsOfAttachments()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLatestVersionsOfAttachments in class ContentEntityObject
    • setAttachments

      public void setAttachments(List<Attachment> attachments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setAttachments in class ContentEntityObject
    • addAttachment

      public void addAttachment(Attachment attachment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      addAttachment in class ContentEntityObject
    • removeAttachment

      public void removeAttachment(Attachment attachment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      removeAttachment in class ContentEntityObject
    • getBodyAsStringWithoutMarkup

      public String getBodyAsStringWithoutMarkup()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getBodyAsStringWithoutMarkup in class ContentEntityObject
    • getExcerpt

      public String getExcerpt()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getExcerpt in class ContentEntityObject
    • getAttachmentsUrlPath

      public String getAttachmentsUrlPath()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getAttachmentsUrlPath in class ContentEntityObject
    • getAttachmentNamed

      public Attachment getAttachmentNamed(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getAttachmentNamed in class ContentEntityObject
    • getVersionComment

      public String getVersionComment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getVersionComment in class ContentEntityObject
    • setVersionComment

      public void setVersionComment(String versionComment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setVersionComment in class ContentEntityObject
    • isVersionCommentAvailable

      public boolean isVersionCommentAvailable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      isVersionCommentAvailable in class ContentEntityObject
    • getRenderedVersionComment

      public String getRenderedVersionComment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getRenderedVersionComment in class ContentEntityObject
    • getContentPermissionSet

      public ContentPermissionSet getContentPermissionSet(String type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Note, this method does not return ContentPermissions inherited from the Content's ancestry.
      Overrides:
      getContentPermissionSet in class ContentEntityObject
      Returns:
      a set containing ContentPermissions of this type, or null if there are no content permissions explicitly set on this ContentEntityObject for the type.
    • hasPermissions

      public boolean hasPermissions(String type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hasPermissions in class ContentEntityObject
      Returns:
      true if this content entity object contains any ContentPermissions of the type specified
    • hasContentPermissions

      public boolean hasContentPermissions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hasContentPermissions in class ContentEntityObject
    • addPermission

      public void addPermission(ContentPermission permission)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Adds a ContentPermission. Do not add them manually via ContentPermissionSet.addContentPermission(ContentPermission). If possible use ContentPermissionManager.addContentPermission(com.atlassian.confluence.security.ContentPermission, ContentEntityObject) instead. Also note that as of Confluence 2.4 although methods have been added to facilitate having multiple ContentPermissions per page, Confluence does not yet properly support them (eg users permitted by them will not see the data in their searches)
      Overrides:
      addPermission in class ContentEntityObject
    • removeContentPermissionSet

      public void removeContentPermissionSet(ContentPermissionSet set)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      This method removes the given ContentPermissionSet from this CEO and disconnects the set from its owner. This method should only be called by the DefaultContentPermissionManager. Note that as of Confluence 2.4 although methods have been added to facilitate having multiple ContentPermissions per page, Confluence does not yet properly support them (eg users permitted by them will not see the data in their searches)
      Overrides:
      removeContentPermissionSet in class ContentEntityObject
      See Also:
    • getComments

      public List<Comment> getComments()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getComments in class ContentEntityObject
    • setComments

      public void setComments(List<Comment> comments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setComments in class ContentEntityObject
    • addComment

      public void addComment(Comment comment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      addComment in class ContentEntityObject
    • removeComment

      public void removeComment(Comment comment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      removeComment in class ContentEntityObject
    • getCustomContent

      public List<CustomContentEntityObject> getCustomContent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCustomContent in class ContentEntityObject
      Returns:
      all custom content that is a child of this CEO.
    • addCustomContent

      public void addCustomContent(CustomContentEntityObject customContentEntityObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      addCustomContent in class ContentEntityObject
    • removeCustomContent

      public void removeCustomContent(CustomContentEntityObject customContentEntityObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      removeCustomContent in class ContentEntityObject
    • getEntity

      public ContentEntityObject getEntity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Content
      Gets the ContentEntityObject that backs this piece of content.
      Specified by:
      getEntity in interface Content
      Overrides:
      getEntity in class ContentEntityObject
      Returns:
      the persistent object behind this content
    • getSelector

      public ContentSelector getSelector()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getSelector in interface ContentConvertible
      Overrides:
      getSelector in class ContentEntityObject
      Returns:
      the ContentSelector for this entity, which will always include the id of the latest version, and the version number for this version of the entity.
    • getProperties

      public ContentProperties getProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getProperties in class ContentEntityObject
      Returns:
      the content properties associated with this entity
    • setContentPropertiesFrom

      public void setContentPropertiesFrom(ContentEntityObject ceo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Initialises the ContentProperties of this ContentEntityObject by performing a deep clone of the ContentEntityObject object's properties.
      Overrides:
      setContentPropertiesFrom in class ContentEntityObject
    • getOriginalVersionId

      public Long getOriginalVersionId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getOriginalVersionId in class ContentEntityObject
    • getLatestVersionId

      public long getLatestVersionId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLatestVersionId in class ContentEntityObject
    • setSpace

      public void setSpace(Space space)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setSpace in class SpaceContentEntityObject
    • convertToHistoricalVersion

      public void convertToHistoricalVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Remove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.

      When using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time.

      Specified by:
      convertToHistoricalVersion in interface Versioned
      Overrides:
      convertToHistoricalVersion in class SpaceContentEntityObject
    • getSpaceKey

      public String getSpaceKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getSpaceKey in class SpaceContentEntityObject
    • isInSpace

      public boolean isInSpace(Space space)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      isInSpace in class SpaceContentEntityObject
    • getFileName

      public @NonNull String getFileName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SearchableAttachment
      Gets the filename of this attachment. If there is no filename, return the empty string. This method should never return null.
      Specified by:
      getFileName in interface SearchableAttachment
      Overrides:
      getFileName in class Attachment
      Returns:
      the filename of this attachment, or the empty string if there is no filename
    • setFileName

      public void setFileName(@NonNull String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setFileName in class Attachment
    • getMediaType

      public @NonNull String getMediaType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getMediaType in class Attachment
    • setMediaType

      public void setMediaType(@NonNull String mediaType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setMediaType in class Attachment
    • getContentType

      public @NonNull String getContentType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SearchableAttachment
      Gets the MIME content-type of this attachment. If there is no content-type, return "application/x-unknown". Should never return null.
      Specified by:
      getContentType in interface SearchableAttachment
      Overrides:
      getContentType in class Attachment
      Returns:
      the MIME content-type of the attachment, or "application/x-unknown" if the MIME type is unknown
    • setContentType

      public void setContentType(@NonNull String contentType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setContentType in class Attachment
    • getContainer

      public @Nullable ContentEntityObject getContainer()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getContainer in interface Contained<ContentEntityObject>
      Overrides:
      getContainer in class Attachment
      Returns:
      the owner of this content object. Can be null.
    • setContainer

      public void setContainer(ContentEntityObject content)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setContainer in class Attachment
    • getComment

      public String getComment()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SearchableAttachment
      Return any comment associated with this attachment
      Specified by:
      getComment in interface SearchableAttachment
      Overrides:
      getComment in class Attachment
    • isMinorEdit

      public boolean isMinorEdit()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Indicates whether this attachment is supposed to be hidden under normal circumstances. At the moment this is only used to avoid sending notifications and to hide them in the activity stream. Future usages should be hiding them by default in the attachment macro output
      Overrides:
      isMinorEdit in class Attachment
      Returns:
      true, if the attachment is hidden
    • setMinorEdit

      public void setMinorEdit(boolean minorEdit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setMinorEdit in class Attachment
    • getFileStoreId

      public String getFileStoreId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getFileStoreId in class Attachment
      Returns:
      FileStore ID of the binary data of this attachment
    • setFileStoreId

      public void setFileStoreId(String fileStoreId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setFileStoreId in class Attachment
    • isHidden

      public boolean isHidden()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Indicates whether this attachment is supposed to be strictly hidden from displaying and searching Hidden attachment is not indexable Hidden attachment manipulation will not trigger external notification events
      Overrides:
      isHidden in class Attachment
      Returns:
      true, if the attachment is hidden
    • setHidden

      public void setHidden(boolean hidden)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setHidden in class Attachment
    • getFileSize

      public long getFileSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getFileSize in class Attachment
      Returns:
      The size (in bytes) of the attachment's raw binary data
    • setFileSize

      public void setFileSize(long fileSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setFileSize in class Attachment
    • getNiceFileSize

      public String getNiceFileSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getNiceFileSize in interface SearchableAttachment
      Overrides:
      getNiceFileSize in class Attachment
    • getNiceType

      public String getNiceType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getNiceType in interface SearchableAttachment
      Overrides:
      getNiceType in class Attachment
      Returns:
      A nice type for this file if possible (eg "PDF" or "Word") - or null if no nice type can be recognised
    • getType

      public String getType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

      This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

      Specified by:
      getType in interface ContentTypeAware
      Overrides:
      getType in class Attachment
      Returns:
      the content type
    • getDisplayTitle

      public String getDisplayTitle()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Returns the display title. Some entities don't have titles for identification. For example, personal information objects use the user's fullname. Override this method to provide a custom title.
      Specified by:
      getDisplayTitle in interface Addressable
      Overrides:
      getDisplayTitle in class Attachment
      Returns:
      the display title
    • getUrlPath

      public @Nullable String getUrlPath()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getUrlPath in interface Addressable
      Overrides:
      getUrlPath in class Attachment
    • getSearchableDependants

      public Collection<Searchable> getSearchableDependants()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Searchable
      When we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.
      Specified by:
      getSearchableDependants in interface Searchable
      Overrides:
      getSearchableDependants in class Attachment
    • isUserProfilePicture

      public boolean isUserProfilePicture()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Determines whether the Attachment is a user's profile picture
      Overrides:
      isUserProfilePicture in class Attachment
      Returns:
      true if it is attached to a PersonalInformation object and has the correct comment
    • isIndexable

      public boolean isIndexable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Only the current version of a non-hidden attachment is indexable (until we can deal with old objects in search results) We also don't want to index attachments associated with drafts or global descriptions or hidden attachments
      Specified by:
      isIndexable in interface Searchable
      Overrides:
      isIndexable in class Attachment
    • getDownloadPath

      public String getDownloadPath()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getDownloadPath in interface SearchableAttachment
      Overrides:
      getDownloadPath in class Attachment
    • getDownloadPathWithoutVersion

      public String getDownloadPathWithoutVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Returns the download path without any version info.
      Overrides:
      getDownloadPathWithoutVersion in class Attachment
    • getDownloadPathWithoutVersionOrApiRevision

      public String getDownloadPathWithoutVersionOrApiRevision()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Returns the download path without any version info or API revision.
      Overrides:
      getDownloadPathWithoutVersionOrApiRevision in class Attachment
    • getDownloadPath

      public String getDownloadPath(String attachmentPath, boolean addVersionInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Returns the download path of the attachment for a given attachmentPath prefix. It basically appends the filename and some meta info to form the path.
      Overrides:
      getDownloadPath in class Attachment
    • getDownloadPathWithoutEncoding

      public String getDownloadPathWithoutEncoding()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getDownloadPathWithoutEncoding in class Attachment
    • getExportPath

      public String getExportPath()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getExportPath in class Attachment
    • getExportPathForThumbnail

      public String getExportPathForThumbnail()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getExportPathForThumbnail in class Attachment
    • getContentsAsStream

      public InputStream getContentsAsStream() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: SearchableAttachment
      Return the contents of the attachment as an InputStream
      Specified by:
      getContentsAsStream in interface SearchableAttachment
      Overrides:
      getContentsAsStream in class Attachment
      Returns:
      an InputStream set at the start of the attachment's contents.
      Throws:
      IOException
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Attachment
    • getNameForComparison

      public String getNameForComparison()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Subclasses should implement this method, giving a String back so that the content can be alphabetically sorted in a mixed-type list of content-entities.
      Overrides:
      getNameForComparison in class Attachment
    • equals

      public boolean equals(Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Attachment
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Attachment
    • getFileExtension

      public String getFileExtension()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Returns the file extension of the attachment. If there is no extension, an empty string is returned.
      Overrides:
      getFileExtension in class Attachment
      Returns:
      the file extension of the attachment in lower case
    • getSpace

      public Space getSpace()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getSpace in interface Spaced
      Overrides:
      getSpace in class Attachment
      Returns:
      the space of the owning content if it can be associated with a space (i.e. of type Spaced), or null otherwise.
    • getLinkWikiMarkup

      public String getLinkWikiMarkup()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getLinkWikiMarkup in interface HasLinkWikiMarkup
      Overrides:
      getLinkWikiMarkup in class Attachment
      Returns:
      the wiki markup used to link to this content
    • clone

      public Object clone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      clone in class Attachment
    • copy

      public Attachment copy()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      copy in class Attachment
    • getVersionChildPolicy

      public VersionChildOwnerPolicy getVersionChildPolicy(ContentType contentType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Versioned
      Returns the right VersionChildOwnerPolicy depending on the passed contentType. By default, VersionChildOwnerPolicy.currentVersion is returned

      Right now, this is only enforced for children with content type Attachment or Comment

      Specified by:
      getVersionChildPolicy in interface Versioned
      Overrides:
      getVersionChildPolicy in class Attachment
    • getContentTypeObject

      public ContentType getContentTypeObject()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getContentTypeObject in interface ContentConvertible
      Overrides:
      getContentTypeObject in class Attachment
      Returns:
      the api ContentType that this ContentConvertible converts to
    • getContentId

      public ContentId getContentId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: ContentEntityObject
      Returns the ContentId for this entity object, if it implements ContentConvertible.

      Subclasses implementing ContentConvertible must override this method.

      Specified by:
      getContentId in interface ContentConvertible
      Overrides:
      getContentId in class Attachment
      Returns:
      the ContentId representation of this object's id
    • shouldConvertToContent

      public boolean shouldConvertToContent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      shouldConvertToContent in interface ContentConvertible
      Overrides:
      shouldConvertToContent in class Attachment
      Returns:
      true if the implementer wants to be part of the core API (default value), false otherwise
    • copyLatestVersion

      public Attachment copyLatestVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Attachment
      Will copy all detail information of an attachment including : - Content Properties - File Name - File Size - Content Type - And set version is 1

      NOTE: it won't copy content history

      Overrides:
      copyLatestVersion in class Attachment
      Returns:
      a copy instance
    • getId

      public long getId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getId in interface Addressable
      Specified by:
      getId in interface EditableLabelable
      Specified by:
      getId in interface Searchable
      Overrides:
      getId in class com.atlassian.core.bean.EntityObject
    • setId

      public void setId(long id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setId in class com.atlassian.core.bean.EntityObject
    • getCreationDate

      public Date getCreationDate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCreationDate in class AnnotatedEntityObject
    • setCreationDate

      public void setCreationDate(Date creationDate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setCreationDate in class com.atlassian.core.bean.EntityObject
    • getLastModificationDate

      public Date getLastModificationDate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getLastModificationDate in class AnnotatedEntityObject
    • setLastModificationDate

      public void setLastModificationDate(Date lastModificationDate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setLastModificationDate in class com.atlassian.core.bean.EntityObject
    • setClock

      public void setClock(com.atlassian.core.util.Clock clock)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setClock in class com.atlassian.core.bean.EntityObject
    • getCurrentDate

      public Date getCurrentDate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getCurrentDate in class com.atlassian.core.bean.EntityObject