curl-library
javacurl
Date: Thu, 01 Nov 2007 15:12:23 +0100
Hello,
I have a problem with sftp protocol. I downloaded all 5 dlls for
Windows from http://sourceforge.net/projects/javacurl and I ran a
prepared test.java program and all was ok for http protocol but when I
changed http for sftp, a perform() method returned '1', this is
ERROR_UNSUPPORTED_PROTOCOL. I thing I have dll(s) without sftp support
but I don't know what to do with this.
My source code is:
CurlGlue cg;
System.loadLibrary("javacurl");
System.loadLibrary("msvcr70");
System.loadLibrary("libeay32");
System.loadLibrary("oldjavacurl");
System.loadLibrary("ssleay32");
test cw = null;
// Register callback write function
cg = new CurlGlue();
// this will throw a ERROR_NO_CALLBACK_INSTANCE exception, non-fatal
try {
cg.setopt(CURL.OPT_WRITEFUNCTION, cw);
} catch (CURLException e) {
System.out.println("Wouldn't have thrown an error if we instantiated
test() first!");
}
// we must first instantiate the CurlWrite interface
cw = new test();
// set the callback function
cg.setopt(CURL.OPT_WRITEFUNCTION, cw);
cg.setopt(CURL.OPT_USERPWD, "user:pass");
cg.setopt(CURL.OPT_PORT, 22);
//cg.setopt(CURL.OPT_QUOTE, "RNFR
/home/jausperger/public_html//g.html\nRNTO
/home/jausperger/public_html//g1.html");
//int result = cg.setopt(CURL.OPT_URL, "https://www.verisign.com/");
int result = cg.setopt(CURL.OPT_URL, "sftp://linuxweb/");
result = cg.perform();
System.err.println(result);
// clean everything up.
cg.finalize();
With regards,
austy
Received on 2007-11-01