roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r438624 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
Date Wed, 30 Aug 2006 21:07:14 GMT
Author: snoopdave
Date: Wed Aug 30 14:07:14 2006
New Revision: 438624

URL: http://svn.apache.org/viewvc?rev=438624&view=rev
Log:
Edit or Media-Edit URI may be used to delete media entry

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java?rev=438624&r1=438623&r2=438624&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
Wed Aug 30 14:07:14 2006
@@ -561,16 +561,18 @@
                         mRoller.getIndexManager().removeEntryIndexOperation(rollerEntry);
                         return;
                     } 
-                } else if (pathInfo[1].equals("resource") && pathInfo[2].endsWith(".media-link"))
{
+                } else if (pathInfo[1].equals("resource")) {
                     String handle = pathInfo[0];
                     WebsiteData website = mRoller.getUserManager().getWebsiteByHandle(handle);
                     if (website == null) {
                         throw new AtomNotFoundException("ERROR: cannot find specified weblog");
                     }
                     if (canEdit(website) && pathInfo.length > 1) {
-                        try {
-                            String fileName = 
-                                pathInfo[2].substring(0, pathInfo[2].length() - ".media-link".length());
+                        try {                            
+                            String fileName = pathInfo[2];
+                            if (pathInfo[2].endsWith(".media-link")) {
+                                fileName = fileName.substring(0, pathInfo[2].length() - ".media-link".length());
+                            }
                             FileManager fmgr = mRoller.getFileManager();
                             fmgr.deleteFile(website.getHandle(), fileName);
                         } catch (Exception e) {
@@ -760,7 +762,7 @@
      */
     public boolean isEntryURI(String[] pathInfo) {
         if (pathInfo.length > 2 && pathInfo[1].equals("entry")) return true;
-        if (pathInfo.length > 2 && pathInfo[1].equals("resource") && pathInfo[2].endsWith(".media-link"))
return true;
+        if (pathInfo.length > 2 && pathInfo[1].equals("resource")) return true;
         return false;
     }
         



Mime
View raw message