Hi,
 I am also a relatively new to Slide. But I did get the sample servlet
up and running. Couple of things that you can check:
As already mentioned,check your port.
Verify if the URL path contains the namespace name defined in your
Domain.xml. Also, the namespace name should end with '/' ( why? Dunno
!!)

I am not sure, but specify the path filespath ( "\files", defined in
domain.xml) in the relativeURL where you want the store the file

Sample code that worked for me:

String uri = "http://localhost:8080/slide/";;
HttpURL httpurl = new HttpURL(uri);
httpurl.setUserinfo("root","root");
WebdavResource webdavResource = new WebdavResource(httpurl);
String fileName = "C:\\test.txt";
File fn = new File(fileName);
String putPath = webdavResource.getPath()+"files/"+fn.getName();
result = webdavResource.putMethod(putPath,fn);

Hope this helps,
Rohini.

-----Original Message-----
From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 7:12 PM
To: [email protected]
Subject: put method

Hello!

I tried to create simple client application similar to described in
http://www.onjava.com/pub/a/onjava/2003/12/23/slide.html

I created method to upload file
    public static void releaseFile(String URL, String fullFilePath,
            String relativeURL) throws IOException {
        HttpURL hrl = new HttpURL(URL);
        WebdavResource wdr = new WebdavResource(hrl);
        wdr.putMethod(relativeURL,
                new FileInputStream(fullFilePath));
        wdr.close();
    }

But when I'm trying to use it, nothing happens - no exceptions are
thrown or whatever else.
In logs i can see

DEBUG 15/36/06 03:36:59 [main] (HttpClient:106) - Java version: 1.4.2-p7
DEBUG 15/36/06 03:36:59 [main] (HttpClient:107) - Java vendor: Sun
Microsystems Inc.
DEBUG 15/36/06 03:36:59 [main] (HttpClient:108) - Java class path:
/home/user/workspace/WebDAV:/home/user/workspace/WebDAV/WEB-INF/classes:
/usr/local/eclipse/plugins/org.junit_3.8.1/junit.jar:/home/user/workspac
e/WebDAV/WEB-INF/lib/ant.jar:/home/user/workspace/WebDAV/WEB-INF/lib/com
mons-codec-1.3.jar:/home/user/workspace/WebDAV/WEB-INF/lib/commons-colle
ctions-2.1.jar:/home/user/workspace/WebDAV/WEB-INF/lib/commons-dbcp-1.2.
1.jar:/home/user/workspace/WebDAV/WEB-INF/lib/commons-httpclient.jar:/ho
me/user/workspace/WebDAV/WEB-INF/lib/commons-lang-2.0.jar:/home/user/wor
kspace/WebDAV/WEB-INF/lib/commons-logging-1.0.4.jar:/home/user/workspace
/WebDAV/WEB-INF/lib/commons-pool-1.1.jar:/home/user/workspace/WebDAV/WEB
-INF/lib/commons-transaction-1.1.1pre1.jar:/home/user/workspace/WebDAV/W
EB-INF/lib/commons-xmlio-0.1pre.jar:/home/user/workspace/WebDAV/WEB-INF/
lib/db-ojb-1.0.1.jar:/home/user/workspace/WebDAV/WEB-INF/lib/ehcache-1.0
.jar:/home/user/workspace/WebDAV/WEB-INF/lib/geronimo-jta.jar:/home/user
/workspace/WebDAV/WEB-INF/lib/jakarta-slide-wck-1.0.jar:/home/user/works
pace/WebDAV/WEB-INF/lib/jakarta-slide-webdavlib-2.2pre1.jar:/home/user/w
orkspace/WebDAV/WEB-INF/lib/jaxen-core.jar:/home/user/workspace/WebDAV/W
EB-INF/lib/jaxen-jdom.jar:/home/user/workspace/WebDAV/WEB-INF/lib/jdom-1
.0.jar:/home/user/workspace/WebDAV/WEB-INF/lib/log4j-1.2.8.jar:/home/use
r/workspace/WebDAV/WEB-INF/lib/lucene-1.4-final.jar:/home/user/workspace
/WebDAV/WEB-INF/lib/PDFBox-0.6.5.jar:/home/user/workspace/WebDAV/WEB-INF
/lib/poi-2.5-final-20040428.jar:/home/user/workspace/WebDAV/WEB-INF/lib/
saxpath.jar:/home/user/workspace/WebDAV/WEB-INF/lib/slide-jaas-2.2pre1.j
ar:/home/user/workspace/WebDAV/WEB-INF/lib/slide-jdk14logger-2.2pre1.jar
:/home/user/workspace/WebDAV/WEB-INF/lib/slide-kernel-2.2pre1.jar:/home/
user/workspace/WebDAV/WEB-INF/lib/slide-log4jlogger-2.2pre1.jar:/home/us
er/workspace/WebDAV/WEB-INF/lib/slide-roles-2.2pre1.jar:/home/user/works
pace/WebDAV/WEB-INF/lib/slide-stores-2.2pre1.jar:/home/user/workspace/We
bDAV/WEB-INF/lib/slide-webdavservlet-2.2pre1.jar:/home/user/workspace/We
bDAV/WEB-INF/lib/tm-extractors-0.4.jar:/usr/local/eclipse/plugins/org.ec
lipse.jdt.junit_3.1.1/junitsupport.jar:/usr/local/eclipse/plugins/org.ec
lipse.jdt.junit.runtime_3.1.0/junitruntime.jar
DEBUG 15/36/06 03:36:59 [main] (HttpClient:109) - Operating system name:
FreeBSD
DEBUG 15/36/06 03:36:59 [main] (HttpClient:110) - Operating system
architecture: i386
DEBUG 15/36/06 03:36:59 [main] (HttpClient:111) - Operating system
version: 5.5-PRERELEASE
DEBUG 15/37/06 03:37:00 [main] (HttpClient:116) - SUN 1.42: SUN (DSA
key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom;
X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX
CertPathBuilder; LDAP, Collection CertStores)
DEBUG 15/37/06 03:37:00 [main] (HttpClient:116) - SunJSSE 1.42: Sun JSSE
provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories,
SSLv3, TLSv1)
DEBUG 15/37/06 03:37:00 [main] (HttpClient:116) - SunRsaSign 1.42: SUN's
provider for RSA signatures
DEBUG 15/37/06 03:37:00 [main] (HttpClient:116) - SunJCE 1.42: SunJCE
Provider (implements DES, Triple DES, AES, Blowfish, PBE,
Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
DEBUG 15/37/06 03:37:00 [main] (HttpClient:116) - SunJGSS 1.0: Sun
(Kerberos v5)
DEBUG 15/37/06 03:37:00 [main] (HttpConnection:617) -
HttpConnection.setSoTimeout(0)
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:1085) - Execute loop try
1
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:2650) - Attempt number 1
to process request
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "PROPFIND /
HTTP/1.1[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:1559) - Adding Host
request header
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Content-Type: text/xml;
charset=utf-8[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "User-Agent: Jakarta
Commons-HttpClient/2.0rc3[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Host:
localhost:8180[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Content-Length:
207[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Depth: 0[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - >> "<?xml version="1.0"
encoding="utf-8" ?><D:propfind
xmlns:D="DAV:"><D:prop><D:displayname/><D:getcontentlength/><D:getconten
ttype/><D:resourcetype/><D:getlastmodified/><D:lockdiscovery/></D:prop><
/D:propfind>"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "HTTP/1.1 400 No Host
matches server name localhost[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Transfer-Encoding:
chunked[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Date: Wed, 15 Feb 2006
13:37:00 GMT[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Server:
Apache-Coyote/1.1[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Connection:
close[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpConnection:634) -
HttpConnection.getSoTimeout()
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "0"
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "[\r]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "[\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "[\r]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "[\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:922) - Should close
connection in response to Connection: close

DEBUG 15/37/06 03:37:00 [main] (HttpConnection:469) - Connection is
stale, closing...
DEBUG 15/37/06 03:37:00 [main] (HttpConnection:617) -
HttpConnection.setSoTimeout(0)
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:1085) - Execute loop try
1
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:2650) - Attempt number 1
to process request
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "PUT
/files/1.txt/1140010679250 HTTP/1.1[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:1559) - Adding Host
request header
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:450) -
HttpMethodBase.addRequestHeader(Header)
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "User-Agent: Jakarta
Commons-HttpClient/2.0rc3[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Host:
localhost:8180[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "Transfer-Encoding:
chunked[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (EntityEnclosingMethod:450) - Using
unbuffered request body
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "d[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "test [\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "passed[\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (ChunkedOutputStream:210) - Writing chunk
(length: 13)
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - >> "0"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - >> "[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (ChunkedOutputStream:230) - Writing
closing chunk
DEBUG 15/37/06 03:37:00 [main] (EntityEnclosingMethod:500) - Request
body sent
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "HTTP/1.1 400 No Host
matches server name localhost[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Transfer-Encoding:
chunked[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Date: Wed, 15 Feb 2006
13:37:00 GMT[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Server:
Apache-Coyote/1.1[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "Connection:
close[\r][\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpConnection:634) -
HttpConnection.getSoTimeout()
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "0"
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "[\r]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "[\n]"
DEBUG 15/37/06 03:37:00 [main] (Wire:119) - << "[\r]"
DEBUG 15/37/06 03:37:00 [main] (Wire:105) - << "[\n]"
DEBUG 15/37/06 03:37:00 [main] (HttpMethodBase:922) - Should close
connection in response to Connection: close

--
Eugene N Dzhurinsky

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




**********************************************************

The information contained in, or attached to, this e-mail, contains 
confidential information and is intended solely for the use of the individual 
or entity to whom they are addressed and is subject to legal privilege. If you 
have received this e-mail in error you should notify the sender immediately by 
reply e-mail, delete the message from your system and notify your system 
manager. Please do not copy it for any purpose, or disclose its contents to any 
other person. The views or opinions presented in this e-mail are solely those 
of the author and do not necessarily represent those of the company. The 
recipient should check this e-mail and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused, directly or 
indirectly, by any virus transmitted in this email

************************************************************

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

Reply via email to