I ended up creating a local temp file to resolve my problem:
// TMP_DIR = "/c:/tmp"
File tmpDir = new File(TMP_DIR);
// TMP_FILE = "temp.jar"
File tmpFile = new File(tmpDir, TMP_FILE);
// pathToJar is the SFTP uri
FileObject fileObject = defFileSysMgr.resolveFile(pathToJar, fso);
// populate tmpFile from the SftpFileObject
FileUtil.copyContent(fileObject, defFileSysMgr.toFileObject(tmpFile));
// read the local jar file
FileObject jarFileObject = defFileSysMgr.resolveFile("jar:" + TMP_DIR + "/"
+ TMP_FILE);
On 2/22/06, Rai Singh <[EMAIL PROTECTED]> wrote:
>
> I was successful when using:
> sftp://username:[EMAIL PROTECTED]
> /apps/web/eis81/WLS81SP4/domains/neodomain/neo/dist/crosssell.jar
>
> I also attempting to connect via an SFTP client and was successful.
> Permissions are okay.
>
> As part of the stacktrace, the following exception seems to indicate that
> an attempt to create a
> temporary file is being made. Do I need to configure a FileReplicator?
>
> Caused by: org.apache.commons.vfs.FileSystemException : No file replicator
> configured.
>
> This code works and returns an SftpFileObject:
> // pathToJar - sftp://username:[EMAIL PROTECTED]
> /apps/web/eis81/WLS81SP4/domains/neodomain/neo/dist/crosssell.jar
> FileObject fileObject = defFileSysMgr.resolveFile(pathToJar, fso);
>
> This code does not and causes the exception above:
> defFileSysMgr.resolveFile("jar:" + fileObject + "!/", fso)
>
> fso is defined as
> fso = new FileSystemOptions();
>
> SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso,
> "no");
> SftpFileSystemConfigBuilder.getInstance().setUserInfo(fso, new
> TrustEveryoneUserInfo());
>
> I am using VFS RC8.
>
> Thanks,
> Rai
>
> On 2/22/06, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> >
> > Hi!
> > > I am attempting to retrieve the content of a jar resource via sftp
> > with the
> > > following:
> > > jar:sftp://username:[EMAIL PROTECTED]
> > > /apps/web/eis81/WLS81SP4/domains/neodomain/neo/dist/crosssell.jar!/
> > >
> > > However, I receive:
> > > Caused by: org.apache.commons.vfs.FileSystemException: Could not
> > replicate "
> > > sftp://username:[EMAIL PROTECTED]
> > > /apps/web/eis81/WLS81SP4/domains/neodomain/neo/dist/crosssell.jar".
> > >
> > Looks good to me. Try to copy the file without the jar: stuff, just to
> > see if you get successfully connected.
> >
> > Ciao,
> > Mario
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>