jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rencana Tarigan <rencana_tari...@yahoo.co.id>
Subject Add property to a folder
Date Fri, 09 Jul 2010 19:53:56 GMT
Hi all,
I have code to add property to a folder or file at jackrabbit like this :

DavPropertySet newProps = new DavPropertySet();
         DavPropertyNameSet removeProperties = new DavPropertyNameSet();
         DavProperty<String> testProp = new 
DefaultDavProperty<String>(propKey.replaceAll(" ","_"), propValue, 
DavConstants.NAMESPACE);
         newProps.add(testProp);
         PropPatchMethod proPatch = null;
         boolean b_returnCode = false;
         try {
             proPatch = new PropPatchMethod(FileShipUtils.getInstance()
                     .getFullPath(remotePath.substring(-1)), newProps, 
removeProperties);
             //client.getParams().setAuthenticationPreemptive(false);

             client.executeMethod(proPatch);

             //System.out.println(proPatch.getStatusCode() + " "    + 
proPatch.getStatusText());
             //proPatch.checkSuccess();
             b_returnCode = true;// success
             proPatch.releaseConnection();

         } catch (IOException e) {
             e.printStackTrace();
             b_returnCode = false;
         }

This code is success to add property to a file but not work to a 
folder/collection, any suggestion for this problem ?

Thanks.

-- 
-----=====*=====-----
Rencana Tarigan
+6285270567856
YM   : rencana_tarigan
Skype: rencana.tarigan
http://cana.web.id


Mime
View raw message