Package com.xwiki.pdfviewer.macro
Class PDFFile
- java.lang.Object
-
- com.xwiki.pdfviewer.macro.PDFFile
-
public class PDFFile extends Object
Represents the resources for a given attachment.- Since:
- 2.6
- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareViewRightsDelegated()Return the delegated view rights.Optional<org.xwiki.model.reference.AttachmentReference>getAttachmentReference()Get PDF file reference.StringgetURL()Get the file download url.booleanhasViewRights()Check if the view rights are given.voidsetAttachmentReference(org.xwiki.model.reference.AttachmentReference attachmentReference)voidsetDelegatedViewRights(boolean delegatedViewRights)voidsetHasViewRights(boolean hasViewRights)SeehasViewRights().voidsetUrl(String url)SeegetURL().
-
-
-
Constructor Detail
-
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 Detail
-
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
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
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.
-
-