Class PDFFile


  • public class PDFFile
    extends Object
    Represents the resources for a given attachment.
    Since:
    2.6
    Version:
    $Id$
    • Constructor Detail

      • PDFFile

        public PDFFile()
        Empty constructor.
      • PDFFile

        public PDFFile​(org.xwiki.model.reference.AttachmentReference attachmentReference,
                       String url,
                       boolean hasViewRights)
        Default constructor.
        Parameters:
        attachmentReference - the AttachmentReference of the PDF file.
        url - file download url.
        hasViewRights - true if the view rights are given, or false otherwise.
    • Method Detail

      • setHasViewRights

        public void setHasViewRights​(boolean hasViewRights)
        Parameters:
        hasViewRights - true if the view rights are given, or false otherwise
      • hasViewRights

        public boolean hasViewRights()
        Check if the view rights are given.
        Returns:
        true if the view rights are given, or false otherwise
      • getURL

        public String getURL()
        Get the file download url.
        Returns:
        the file download url.
      • getAttachmentReference

        public Optional<org.xwiki.model.reference.AttachmentReference> getAttachmentReference()
        Get PDF file reference.
        Returns:
        an Optional AttachmentReference, if the PDF file is attached to a wiki page.
      • setAttachmentReference

        public void setAttachmentReference​(org.xwiki.model.reference.AttachmentReference attachmentReference)
        Parameters:
        attachmentReference - the attachment reference.
      • areViewRightsDelegated

        public boolean areViewRightsDelegated()
        Return the delegated view rights.
        Returns:
        true if the view rights have been delegated and false otherwise.
      • setDelegatedViewRights

        public void setDelegatedViewRights​(boolean delegatedViewRights)
        Parameters:
        delegatedViewRights - the given view rights.
      • setUrl

        public void setUrl​(String url)
        Parameters:
        url - the url to the attachment.