Author: ajaquith
Date: Sun Apr 19 22:18:55 2009
New Revision: 766529

URL: http://svn.apache.org/viewvc?rev=766529&view=rev
Log:
Fixed bug in JCRWikiPage.isAttachment() that caused non-existent pages to be 
erroneously treated as attachments.

Modified:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java?rev=766529&r1=766528&r2=766529&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java Sun Apr 
19 22:18:55 2009
@@ -598,11 +598,15 @@
         
     }
 
+    /**
+     * Returns <code>true</code> if this WikiPage exists in the repository and 
is of any content
+     * type other than {...@link ContentManager.JSPWIKI_CONTENT_TYPE}; 
<code>false</code> otherwise.
+     */
     public boolean isAttachment() throws ProviderException
     {
         String contentType = getContentType();
-        
-        if( ContentManager.JSPWIKI_CONTENT_TYPE.equals( contentType ) ) return 
false;
+        boolean exists = m_engine.getContentManager().pageExists( getPath() );
+        if( !exists || ContentManager.JSPWIKI_CONTENT_TYPE.equals( contentType 
) ) return false;
         
         return true;
     }


Reply via email to