You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2020/03/16 21:58:25 UTC
[jspwiki] 35/47: JSPWIKI-303: o.a.w.attachment.Attachment
implements o.a.w.api.core.Attachment
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 60b6bb462feeeaed1557da252e89a34256177818
Author: juanpablo <ju...@apache.org>
AuthorDate: Sun Mar 15 18:44:49 2020 +0100
JSPWIKI-303: o.a.w.attachment.Attachment implements o.a.w.api.core.Attachment
---
.../org/apache/wiki/attachment/Attachment.java | 64 +++++++++++-----------
1 file changed, 31 insertions(+), 33 deletions(-)
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java b/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
index fb59deb..7f9b068 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/attachment/Attachment.java
@@ -25,80 +25,78 @@ import org.apache.wiki.api.core.Engine;
/**
* Describes an attachment. Attachments are actually derivatives of a WikiPage, since they do actually have a WikiName as well.
*/
-public class Attachment extends WikiPage {
+public class Attachment extends WikiPage implements org.apache.wiki.api.core.Attachment {
private String m_fileName;
private String m_parentName;
private boolean m_cacheable = true;
/**
- * Creates a new attachment. The final name of the attachment will be
- * a synthesis of the parent page name and the file name.
- *
- * @param engine The Engine which is hosting this attachment.
- * @param parentPage The page which will contain this attachment.
- * @param fileName The file name for the attachment.
+ * Creates a new attachment. The final name of the attachment will be a synthesis of the parent page name and the file name.
+ *
+ * @param engine The Engine which is hosting this attachment.
+ * @param parentPage The page which will contain this attachment.
+ * @param fileName The file name for the attachment.
*/
public Attachment( final Engine engine, final String parentPage, final String fileName ) {
super( engine, parentPage + "/" + fileName );
-
m_parentName = parentPage;
- m_fileName = fileName;
+ m_fileName = fileName;
}
/**
- * Returns a human-readable, only-debugging-suitable description.
- *
- * @return A debugging string
+ * Returns a human-readable, only-debugging-suitable description.
+ *
+ * @return A debugging string
*/
- @Override public String toString() {
+ @Override
+ public String toString() {
return "Attachment [" + getName() + ";mod=" + getLastModified() + "]";
}
/**
- * Returns the file name of the attachment.
- *
- * @return A String with the file name.
+ * Returns the file name of the attachment.
+ *
+ * @return A String with the file name.
*/
public String getFileName() {
return m_fileName;
}
/**
- * Sets the file name of this attachment.
- *
- * @param name The name of the attachment. Must be a legal file name without the path.
+ * Sets the file name of this attachment.
+ *
+ * @param name The name of the attachment. Must be a legal file name without the path.
*/
- public void setFileName( final String name )
- {
+ public void setFileName( final String name ) {
m_fileName = name;
}
/**
- * Returns the name of the parent of this Attachment, i.e. the page which contains this attachment.
- *
- * @return String depicting the parent of the attachment.
+ * Returns the name of the parent of this Attachment, i.e. the page which contains this attachment.
+ *
+ * @return String depicting the parent of the attachment.
*/
public String getParentName() {
return m_parentName;
}
/**
- * Returns true, if this attachment can be cached by the user agent. By default attachments are cacheable.
- *
- * @return False, if the attachment should not be cached by the user agent.
- * @since 2.5.34
+ * Returns true, if this attachment can be cached by the user agent. By default attachments are cacheable.
+ *
+ * @return False, if the attachment should not be cached by the user agent.
+ * @since 2.5.34
*/
public boolean isCacheable() {
return m_cacheable;
}
/**
- * Sets this attachment to be cacheable or not. This mostly concerns things like DynamicAttachments, but it may be useful for
- * certain AttachmentProviders as well.
- *
- * @param value True or false, depending on whether you want this attachment to be cacheable or not.
- * @since 2.5.34
+ * Sets this attachment to be cacheable or not. This mostly concerns things like DynamicAttachments, but it may be useful for
+ * certain AttachmentProviders as well.
+ *
+ * @param value True or false, depending on whether you want this attachment to be cacheable or not.
+ * @since 2.5.34
*/
public void setCacheable( final boolean value ) {
m_cacheable = value;