commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ingo Maas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (VFS-263) WebdavFileObject does not implement doSetAttribute()
Date Fri, 14 Aug 2009 13:55:14 GMT

    [ https://issues.apache.org/jira/browse/VFS-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743204#action_12743204
] 

Ingo Maas commented on VFS-263:
-------------------------------

The way I've solved it for me:
////
    protected void doSetAttribute(String attrName, 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 porperty
        }
        
        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);
      }
    } 

> WebdavFileObject does not implement doSetAttribute()
> ----------------------------------------------------
>
>                 Key: VFS-263
>                 URL: https://issues.apache.org/jira/browse/VFS-263
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: all
>            Reporter: Ingo Maas
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> Usually, WebDAV servers allow to read from _and_ write to properties (attributes in VFS
speech) of a WebDAV resource.
> Though WebdavFileObject in current TRUNK allows to read those properties, it doesn't
allow to write them. WebdavFileObject should implement doSetAttribute() to fully support WebDAV
properties.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message