Class AttachmentDiff


  • public class AttachmentDiff
    extends Object
    Safe version of AttachmentDiff that can be used by the scripts.
    Since:
    7.0RC1
    Version:
    $Id: 2079cb05ad1fb5c79d5352b2aa1dda72fd7da176 $
    • Constructor Detail

      • AttachmentDiff

        public AttachmentDiff​(AttachmentDiff diff,
                              XWikiContext context)
        Wraps the given unsafe attachment difference.
        Parameters:
        diff - the unsafe attachment difference
        context - the XWiki context needed to create the safe versions of XWikiAttachment
    • Method Detail

      • getFileName

        public String getFileName()
        Returns:
        the name of the attachment whose versions are being compared
      • getType

        public String getType()
        Returns:
        the type of difference (one of 'insert', 'delete', 'change')
      • getOrigAttachment

        public Attachment getOrigAttachment()
        Returns:
        the original version of the attachment
      • getNewAttachment

        public Attachment getNewAttachment()
        Returns:
        the new version of the attachment
      • getOrigVersion

        @Deprecated
        public String getOrigVersion()
        Deprecated.
        NOTE: We kept this method (despite being deprecated) in order to preserve backwards compatibility with existing scripts that were exposed to the unsafe AttachmentDiff.
        Returns:
        the original attachment version
      • getNewVersion

        @Deprecated
        public String getNewVersion()
        Deprecated.
        NOTE: We kept this method (despite being deprecated) in order to preserve backwards compatibility with existing scripts that were exposed to the unsafe AttachmentDiff.
        Returns:
        the new attachment version