Just a note...
I got that VFS to work also avoiding the "unknown scheme" error

Sample...

<cfscript>
    fso = CreateObject("java",
"org.apache.commons.vfs.FileSystemOptions").init();
    CreateObject("java",
"org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder").getInstance().setStrictHostKeyChecking(fso,
"no");
        Selectors = CreateObject("java", "org.apache.commons.vfs.Selectors");

    fsManager = CreateObject("java",
"org.apache.commons.vfs.VFS").getManager();

    uri = "sftp://user:password@host/path/to/target/file/
filename.txt";

    fo = fsManager.resolveFile(uri, fso);
    lfo = fsManager.resolveFile("/tmp/sourcefile.txt");

    fo.copyFrom(lfo, Selectors.SELECT_SELF);

    lfo.close();
    fs = fo.getFileSystem();

    fsManager.closeFileSystem(fs);
</cfscript>

So, just have to upload the file using CFFILE into the /tmp and from
there send it to the correct user acount for the privilidges to work.
So now I only have to wrap this up into a TAG (probably a cf_sftp
until we get ftp and sftp support into CFFILE)

I'm using this for generating an external table in Oracle from OpenBD.
The Jetty/OpenBD is not running under the account of Oracle and Oracle
don't like external table sources from any other OS account... But
this solved the problem

Thanks all of you for pointing me into the right direction on this!!

/Mats/
On Mar 15, 3:44 pm, Matthew Woodward <[email protected]> wrote:
> On Tue, Mar 15, 2011 at 6:18 AM, Mats Stromberg <[email protected]>wrote:
>
> > it would have been nice if it would have
> > worked the other way too though... Probably less "wonky" to get the
> > rest of the code implemented.
>
> Not the reason it's a pain (at least in my opinion) but feel free to
> experiment. The reasons jsch is a pain from my perspective are:
> A) no javadocs
> B) their examples are all GUI examples and they do weird inner class stuff
> even for logging in
> C) I created a Java project in Eclipse and started messing with things and
> the classes don't behave as they outline in their samples.
>
> Regarding C, I don't know if they've changed their API but with the jsch jar
> in a project in Eclipse, code samples like this didn't work for 
> me:http://sthen.blogspot.com/2008/03/sftp-i-java-with-jsch-using-private...
>
> Even seemingly basic stuff like jsch.getSession("user", "host", 22) was
> "wrong" according to Eclipse. In short, javadocs would be nice (maybe I'm
> just not seeing them on their site).
>
> As always I'm happy to be proven wrong. Was just way more of a headache than
> I thought it should be so I decided to burn my time trying the other method.
>
> > I will now try to play around with both versions for a while.
> > In Den's code sample there was a notice about closing the filemanager
> > wich could?? explain your problem Matthew with your test on the second
> > run.
>
> That's what the link I shared was 
> for:http://wiki.apache.org/commons/SimpleSftpFileDownload
>
> It was late by the time I hit that so I didn't dig into it further. They
> outline a different way of closing connections that's supposed to fix the
> "unknown scheme" error.
>
> --
> Matthew Woodward
> [email protected]http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to