You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/02/16 17:57:10 UTC

svn commit: r1824544 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java

Author: tilman
Date: Fri Feb 16 17:57:10 2018
New Revision: 1824544

URL: http://svn.apache.org/viewvc?rev=1824544&view=rev
Log:
PDFBOX-4071: fix typo, deprecate method that had typo, new method without typo

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java?rev=1824544&r1=1824543&r2=1824544&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationFileAttachment.java Fri Feb 16 17:57:10 2018
@@ -23,7 +23,7 @@ import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification;
 
 /**
- * This is the class that represents a file attachement.
+ * This is the class that represents a file attachment.
  *
  * @author Ben Litchfield
  */
@@ -98,16 +98,28 @@ public class PDAnnotationFileAttachment
      */
     public String getAttachmentName()
     {
-        return getCOSObject().getNameAsString("Name", ATTACHMENT_NAME_PUSH_PIN);
+        return getCOSObject().getNameAsString(COSName.NAME, ATTACHMENT_NAME_PUSH_PIN);
     }
 
     /**
-     * Set the name used to draw the attachement icon. See the ATTACHMENT_NAME_XXX constants.
+     * Set the name used to draw the attachment icon. See the ATTACHMENT_NAME_XXX constants.
      *
      * @param name The name of the visual icon to draw.
+     * @deprecated use {@link #setAttachmentName(java.lang.String)}.
      */
+    @Deprecated
     public void setAttachementName(String name)
     {
-        getCOSObject().setName("Name", name);
+        getCOSObject().setName(COSName.NAME, name);
+    }
+
+    /**
+     * Set the name used to draw the attachment icon. See the ATTACHMENT_NAME_XXX constants.
+     *
+     * @param name The name of the visual icon to draw.
+     */
+    public void setAttachmentName(String name)
+    {
+        getCOSObject().setName(COSName.NAME, name);
     }
 }