You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Morten <li...@kikobu.com> on 2004/11/16 10:39:48 UTC
Adding a user by mkcol
Hi. Using the client API to try and create a user (inspired by the
creating users howto):
public void createUser(String name) throws IOException {
WebdavResource wdr = new WebdavResource(http, USER_BASE);
wdr.mkcolMethod("something");
WebdavResources res = wdr.getChildResources();
Enumeration e = res.getResourceNames();
while(e.hasMoreElements()) {
String s = (String)e.nextElement();
System.out.println("--> "+s);
}
wdr.close();
}
This outputs:
--> john2
--> root
--> john
--> guest
--> projector
And not the newly created collection "something"- what am I doing wrong?
There's nothing suspicious in the log.
Br,
Morten
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
RE: Adding a user by mkcol
Posted by Nick Longinow <ni...@vanhooseassociates.com>.
Try using a full uri for the mkcolmethod, ie
wdr.mkcolMethod("/slide/users/blabla");
The wiki for creating folders is a good pointer,
http://wiki.apache.org/jakarta-slide/CreateNewDirectoryAndFile
Nick
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Morten
Sent: Tuesday, November 16, 2004 5:07 PM
To: slide-user@jakarta.apache.org
Subject: Re: Adding a user by mkcol
Nick Longinow wrote:
> I would guess you're mkcolmethod is failing. Check the return value for
> 'true', and then look at wdr.getStatusCode() to see what failed.
Indeed Nick, thanks. I got a statuscode 400, bad request. What I do is,
on a tomcat bundled 2.1b2 with default configuration:
HttpURL http = new HttpURL("http://127.0.0.1:8080");
http.setUserinfo("root", "root");
WebdavResource wdr = new WebdavResource(http, "/slide/users");
wdr.mkcolMethod("blabla");
And that returns 400 Bad Request. Any tips on how to troubleshoot? Is
this not the way I'm supposed to create a user via the client API?
Br,
Morten
> Nick
>
> -----Original Message-----
> From: Morten [mailto:lists@kikobu.com]
> Sent: Tuesday, November 16, 2004 4:40 AM
> To: slide-user@jakarta.apache.org
> Subject: Adding a user by mkcol
>
>
> Hi. Using the client API to try and create a user (inspired by the
> creating users howto):
>
> public void createUser(String name) throws IOException {
> WebdavResource wdr = new WebdavResource(http, USER_BASE);
> wdr.mkcolMethod("something");
> WebdavResources res = wdr.getChildResources();
> Enumeration e = res.getResourceNames();
>
> while(e.hasMoreElements()) {
> String s = (String)e.nextElement();
> System.out.println("--> "+s);
> }
> wdr.close();
> }
>
> This outputs:
>
> --> john2
> --> root
> --> john
> --> guest
> --> projector
>
> And not the newly created collection "something"- what am I doing wrong?
> There's nothing suspicious in the log.
>
> Br,
>
> Morten
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
Re: Adding a user by mkcol
Posted by Morten <li...@kikobu.com>.
Nick Longinow wrote:
> I would guess you're mkcolmethod is failing. Check the return value for
> 'true', and then look at wdr.getStatusCode() to see what failed.
Indeed Nick, thanks. I got a statuscode 400, bad request. What I do is,
on a tomcat bundled 2.1b2 with default configuration:
HttpURL http = new HttpURL("http://127.0.0.1:8080");
http.setUserinfo("root", "root");
WebdavResource wdr = new WebdavResource(http, "/slide/users");
wdr.mkcolMethod("blabla");
And that returns 400 Bad Request. Any tips on how to troubleshoot? Is
this not the way I'm supposed to create a user via the client API?
Br,
Morten
> Nick
>
> -----Original Message-----
> From: Morten [mailto:lists@kikobu.com]
> Sent: Tuesday, November 16, 2004 4:40 AM
> To: slide-user@jakarta.apache.org
> Subject: Adding a user by mkcol
>
>
> Hi. Using the client API to try and create a user (inspired by the
> creating users howto):
>
> public void createUser(String name) throws IOException {
> WebdavResource wdr = new WebdavResource(http, USER_BASE);
> wdr.mkcolMethod("something");
> WebdavResources res = wdr.getChildResources();
> Enumeration e = res.getResourceNames();
>
> while(e.hasMoreElements()) {
> String s = (String)e.nextElement();
> System.out.println("--> "+s);
> }
> wdr.close();
> }
>
> This outputs:
>
> --> john2
> --> root
> --> john
> --> guest
> --> projector
>
> And not the newly created collection "something"- what am I doing wrong?
> There's nothing suspicious in the log.
>
> Br,
>
> Morten
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
RE: Adding a user by mkcol
Posted by Nick Longinow <ni...@vanhooseassociates.com>.
I would guess you're mkcolmethod is failing. Check the return value for
'true', and then look at wdr.getStatusCode() to see what failed.
Nick
-----Original Message-----
From: Morten [mailto:lists@kikobu.com]
Sent: Tuesday, November 16, 2004 4:40 AM
To: slide-user@jakarta.apache.org
Subject: Adding a user by mkcol
Hi. Using the client API to try and create a user (inspired by the
creating users howto):
public void createUser(String name) throws IOException {
WebdavResource wdr = new WebdavResource(http, USER_BASE);
wdr.mkcolMethod("something");
WebdavResources res = wdr.getChildResources();
Enumeration e = res.getResourceNames();
while(e.hasMoreElements()) {
String s = (String)e.nextElement();
System.out.println("--> "+s);
}
wdr.close();
}
This outputs:
--> john2
--> root
--> john
--> guest
--> projector
And not the newly created collection "something"- what am I doing wrong?
There's nothing suspicious in the log.
Br,
Morten
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org