Package com.xwiki.pdfviewer.macro
Class PDFFile
java.lang.Object
com.xwiki.pdfviewer.macro.PDFFile
Represents the resources for a given attachment.
- Since:
- 2.6
- Version:
- $Id$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the delegated view rights.Optional<org.xwiki.model.reference.AttachmentReference>Get PDF file reference.getURL()Get the file download url.booleanCheck if the view rights are given.voidsetAttachmentReference(org.xwiki.model.reference.AttachmentReference attachmentReference) voidsetDelegatedViewRights(boolean delegatedViewRights) voidsetHasViewRights(boolean hasViewRights) SeehasViewRights().voidSeegetURL().
-
Constructor Details
-
PDFFile
public PDFFile()Empty constructor. -
PDFFile
public PDFFile(org.xwiki.model.reference.AttachmentReference attachmentReference, String url, boolean hasViewRights) Default constructor.- Parameters:
attachmentReference- theAttachmentReferenceof the PDF file.url- file download url.hasViewRights-trueif the view rights are given, orfalseotherwise.
-
-
Method Details
-
setHasViewRights
public void setHasViewRights(boolean hasViewRights) SeehasViewRights().- Parameters:
hasViewRights-trueif the view rights are given, orfalseotherwise
-
hasViewRights
public boolean hasViewRights()Check if the view rights are given.- Returns:
trueif the view rights are given, orfalseotherwise
-
getURL
Get the file download url.- Returns:
- the file download url.
-
getAttachmentReference
Get PDF file reference.- Returns:
- an
OptionalAttachmentReference, 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:
trueif the view rights have been delegated andfalseotherwise.
-
setDelegatedViewRights
public void setDelegatedViewRights(boolean delegatedViewRights) - Parameters:
delegatedViewRights- the given view rights.
-
setUrl
SeegetURL().- Parameters:
url- the url to the attachment.
-