Re: AW: adding properties to files

2004-04-29 Thread Amr Elssamadisy
Thanks Thomas,

Nice catch, but the problem is still the same- I get an exception but 
now depending on the call to propatch it is either 501 or 403  
Details below:

1) Either the installation of tomcat/slide is incorrect.
2) There is a bug with the rc1 server that returns 501 when we try to 
set properties
3) Different line returns forbidden 403  - so this leads me to believe 
that it must be something in the setup  (The text in the tomcat 
process window is http8080-Processor4, 29-Apr-2004 11:36:39, test, 
PROPPATCH, 403 Forbidden, 15
ms, /)

   public void testWebdavReadWriteProperties() throws Exception{
   homeUrl.setUserinfo(test,test);
   WebdavResource res = new WebdavResource(homeUrl);
   assertTrue(res.exists());
   try{
   //write file
   boolean success = res.putMethod(/testFile,);
   assertTrue(res.getStatusMessage(),success);//write an empty 
file   
  
   Enumeration e = res.propfindMethod(1);
   //add property
   WebdavResource newRes = new WebdavResource(homeUrl,/testFile);
   PropertyName prop = new 
PropertyName(newRes.getHttpURL().getURI(), prop);

   success = 
res.proppatchMethod(newRes.getHttpURL().getURI(),prop, val1, true);  
//returns 501 - not supported
   success = res.proppatchMethod(prop, val1, true); //returns 
403 - forbidden...  ??!!
  
   assertTrue(res.getStatusMessage(),success);//write prop 1
  
   }
   finally{
   res.deleteMethod();   
   }
  

So the following modified code still causes the same problem:

Bernert, Thomas wrote:

Hi Amr,
IMO your are trying to change the property of any file, which is set in 'homeUrl', but 
not '/testFile'. Did you've tried to use proppatchMethod() with a total path of the 
requested file?
	WebdavResource.proppatchMethod(String path, 
		 PropertyName propertyName, 
String propertyValue, 
	   boolean action);

Regards,
Thomas
-Ursprüngliche Nachricht-
Von: Amr Elssamadisy [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 28. April 2004 16:33
An: slide mailing list
Betreff: adding properties to files

Hi - I noticed a recent message above asking about the same thing (but using the client) and I don't know if it has been resolved.  Basically - I'm not able to add properties to a file.  The code below returns Not Implemented(501)...  Any ideas?

   public void testWebdavReadWriteProperties() throws Exception{
   homeUrl.setUserinfo(test,test);
   WebdavResource res = new WebdavResource(homeUrl);
   assertTrue(res.exists());
   try{
   //write file
   boolean success = res.putMethod(/testFile,);
   assertTrue(res.getStatusMessage(),success);//write an empty 
file   
  
   //add property
   success = res.proppatchMethod(prop1, val1, true);
   assertTrue(res.getStatusMessage(),success);//write prop 1
  
   }
   finally{
   res.deleteMethod();   
   }
  
   }

Thanks!  Amr

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


adding properties to files

2004-04-28 Thread Amr Elssamadisy
Hi - I noticed a recent message above asking about the same thing (but 
using the client) and I don't know if it has been resolved.  Basically - 
I'm not able to add properties to a file.  The code below returns Not 
Implemented(501)...  Any ideas?

   public void testWebdavReadWriteProperties() throws Exception{
   homeUrl.setUserinfo(test,test);
   WebdavResource res = new WebdavResource(homeUrl);
   assertTrue(res.exists());
   try{
   //write file
   boolean success = res.putMethod(/testFile,);
   assertTrue(res.getStatusMessage(),success);//write an empty 
file   
  
   //add property
   success = res.proppatchMethod(prop1, val1, true);
   assertTrue(res.getStatusMessage(),success);//write prop 1
  
   }
   finally{
   res.deleteMethod();   
   }
  
   }

Thanks!  Amr

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Java Client - putMethod for a new file in a new directory

2004-04-27 Thread Amr Elssamadisy
This is a test that I have written that I think does what you want - 
hope it helps.

   /**
* Expecting user name of test/test to allow a correct login and give
* write permissions
* @throws Exception
*/
   public void testWebdavWriteWithNewDirectory() throws Exception{
   long begin = System.currentTimeMillis();
   homeUrl.setUserinfo(test,test);
   WebdavResource res = new WebdavResource(homeUrl);
   assertTrue(res.exists());
   try{
   boolean success = res.mkcolMethod(/testDir);
   assertTrue(res.getStatusMessage(),success);//write an dir
   success = res.putMethod(/testDir/testFile,);
   assertTrue(res.getStatusMessage(),success);//write an empty 
file   
   }
   finally{
   res.deleteMethod();   
   }
   long end = System.currentTimeMillis();   
   System.out.println(seconds running: + (end-begin)/1000);
   }
  

luke noel-storr wrote:

Hi,

Using the slide Java client I'm trying to create a new file which I want to
create in a directory that doesn't yet exist.
I've tried several things, but can't get any to work.

Say for example I want to create a new file at the URL:

http://localhost:8080/slide/files/data/bob/newfile

and the directory 'bob' does not yet exist, how would I go about doing this?

here is an example of code I have tried:

HttpURL httpURL = new HttpURL(http://localhost:8080/slide/files/data/bob/newfile;);

wdr = new WebdavResource(httpURL, credentials, WebdavResource.NOACTION,
DepthSupport.DEPTH_0);
   
if (wdr.putMethod(bytes))
{
   System.out.println(YES!!);
}
else
{
   System.out.println(NO!!);
}

I have also tried:

HttpURL httpURL = new HttpURL(http://localhost:8080/slide/files/data/;);

wdr = new WebdavResource(httpURL, credentials, WebdavResource.NOACTION,
DepthSupport.DEPTH_0);
   
if (wdr.putMethod(bob/newfile, bytes))
{
   System.out.println(YES!!);
}
else
{
   System.out.println(NO!!);
}

Which also didn't work (and the directory 'data' does exist).

Any pointers, I'm kind of lost here?

Also, out of interest (and it may be related), how would I create a new empty
directory?
Cheers

Luke.
-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Streams in webdav???

2004-04-27 Thread Amr Elssamadisy
I'm trying to create a stream to a webdav file.  Are there any classes 
that will help out in this?

(I've tried FileOutputStream and failed becuase it doesn't know how to 
open something like http://localhost:8080/myfile.txt )

Thanks!

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


WebdavResource - creating an empty file (another newbie question)

2004-04-26 Thread Amr Elssamadisy
Hello everyone,

I've been banging my head against this all day and I can't seem to 
figure out what is wrong.  I hope it is obvious to someone with a bit 
more experience with Webdav
(this is an error with both the stable 1.016 and the new release 
candidate build)

Basically - what I get back is an error 403 : Forbidden. 

Any ideas/directions would be useful.

/**
* Expecting user name of test/test to allow a correct login and give
* write permissions
* @throws Exception
*/
   public void testWebdavWrite() throws Exception{
   HttpURLhomeUrl = new HttpURL(http://localhost:8080/;);
   homeUrl.setUserInfo(test,test);
   WebdavResource res = new WebdavResource(new 
HttpURL(homeUrl,testFile));
   assertFalse(res.exists());
   boolean success = res.putMethod();
   assertTrue(res.getStatusMessage(),success);//write an empty 
file   
   }

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: WebdavResource - creating an empty file (another newbie question)

2004-04-26 Thread Amr Elssamadisy
Yep.  I've tested it successfully with the client.

J H wrote:

Did you make sure that test,test are working by going to 
http://localhost:8080 in your web browser?


From: Amr Elssamadisy [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: slide mailing list [EMAIL PROTECTED]
Subject: WebdavResource - creating an empty file (another newbie 
question)
Date: Mon, 26 Apr 2004 18:22:43 -0400

Hello everyone,

I've been banging my head against this all day and I can't seem to 
figure out what is wrong.  I hope it is obvious to someone with a bit 
more experience with Webdav
(this is an error with both the stable 1.016 and the new release 
candidate build)

Basically - what I get back is an error 403 : Forbidden.

Any ideas/directions would be useful.

/**
* Expecting user name of test/test to allow a correct login and give
* write permissions
* @throws Exception
*/
   public void testWebdavWrite() throws Exception{
   HttpURLhomeUrl = new HttpURL(http://localhost:8080/;);
   homeUrl.setUserInfo(test,test);
   WebdavResource res = new WebdavResource(new 
HttpURL(homeUrl,testFile));
   assertFalse(res.exists());
   boolean success = res.putMethod();
   assertTrue(res.getStatusMessage(),success);//write an empty 
file  }

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Is your PC infected? Get a FREE online computer virus scan from 
McAfee® Security. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: WebdavResource - creating an empty file (another newbie question)

2004-04-26 Thread Amr Elssamadisy
I take that back...

I have been playing around with the security constraints and seem to 
have turned something off

Thanks!

J H wrote:

Did you make sure that test,test are working by going to 
http://localhost:8080 in your web browser?


From: Amr Elssamadisy [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: slide mailing list [EMAIL PROTECTED]
Subject: WebdavResource - creating an empty file (another newbie 
question)
Date: Mon, 26 Apr 2004 18:22:43 -0400

Hello everyone,

I've been banging my head against this all day and I can't seem to 
figure out what is wrong.  I hope it is obvious to someone with a bit 
more experience with Webdav
(this is an error with both the stable 1.016 and the new release 
candidate build)

Basically - what I get back is an error 403 : Forbidden.

Any ideas/directions would be useful.

/**
* Expecting user name of test/test to allow a correct login and give
* write permissions
* @throws Exception
*/
   public void testWebdavWrite() throws Exception{
   HttpURLhomeUrl = new HttpURL(http://localhost:8080/;);
   homeUrl.setUserInfo(test,test);
   WebdavResource res = new WebdavResource(new 
HttpURL(homeUrl,testFile));
   assertFalse(res.exists());
   boolean success = res.putMethod();
   assertTrue(res.getStatusMessage(),success);//write an empty 
file  }

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Is your PC infected? Get a FREE online computer virus scan from 
McAfee® Security. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Complete newbie

2004-04-22 Thread Amr Elssamadisy
Hi,

Wanted to ask if there are any good examples/tutorials for using slide.  
I am especially interested in file and directory manipulation as opposed 
to security  (i.e. use of WebdavFile and WebdavResource etc...)

I've checked the archives and couldn't find anything that looked promising.

Thanks in advance - Amr

--
Amr Elssamadisy
Developer,Researcher,Student
(In no particular order...)
tel: (413) 207-1225
email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]