commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r835214 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java xdocs/changes.xml
Date Thu, 12 Nov 2009 03:56:02 GMT
Author: rgoers
Date: Thu Nov 12 03:56:02 2009
New Revision: 835214

URL: http://svn.apache.org/viewvc?rev=835214&view=rev
Log:
Apply patch for VFS-263

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
    commons/proper/vfs/trunk/xdocs/changes.xml

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java?rev=835214&r1=835213&r2=835214&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
Thu Nov 12 03:56:02 2009
@@ -51,6 +51,7 @@
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.MultiStatus;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.xml.Namespace;
 import org.apache.jackrabbit.webdav.version.DeltaVConstants;
 import org.apache.jackrabbit.webdav.version.VersionControlledResource;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
@@ -306,6 +307,49 @@
         }
     }
 
+    /**
+     * Sets an attribute of this file.  Is only called if {@link #doGetType}
+     * does not return {@link FileType#IMAGINARY}.
+     * <p/>
+     * This implementation throws an exception.
+     */
+    protected void doSetAttribute(final String attrName, final Object value)
+        throws Exception
+    {
+        try
+        {
+            URLFileName fileName = (URLFileName) getName();
+            String urlStr = urlString(fileName);
+            DavPropertySet properties = new DavPropertySet();
+            DavPropertyNameSet propertyNameSet = new DavPropertyNameSet();
+            DavProperty property = new DefaultDavProperty(attrName, value, Namespace.EMPTY_NAMESPACE);
+            if (value != null)
+            {
+                properties.add(property);
+            }
+            else
+            {
+                propertyNameSet.add(property.getName()); // remove property
+            }
+
+            PropPatchMethod method = new PropPatchMethod(urlStr, properties, propertyNameSet);
+            setupMethod(method);
+            execute(method);
+            if (!method.succeeded())
+            {
+                throw new FileSystemException("Property '" + attrName + "' could not be set.");
+            }
+        }
+        catch (FileSystemException fse)
+        {
+            throw fse;
+        }
+        catch(Exception e)
+        {
+            throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(),
e);
+        }
+    }
+
     protected OutputStream doGetOutputStream(boolean bAppend) throws Exception
     {
         return new WebdavOutputStream(this);

Modified: commons/proper/vfs/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/xdocs/changes.xml?rev=835214&r1=835213&r2=835214&view=diff
==============================================================================
--- commons/proper/vfs/trunk/xdocs/changes.xml (original)
+++ commons/proper/vfs/trunk/xdocs/changes.xml Thu Nov 12 03:56:02 2009
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.0" date="in SVN" description="">
+      <action dev="rgoers" type="update" issue="VFS-263" due-to="Ingo Maas">
+        WebdavFileObject does not implement doSetAttribute()
+      </action>
       <action dev="rgoers" type="fix" issue="VFS-259" due-to="Marek Zawirski">
         Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting
       </action>



Mime
View raw message