commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rai Singh" <raigsi...@gmail.com>
Subject Re: [VFS] Retrieving a FileContent instance
Date Thu, 23 Feb 2006 03:42:32 GMT
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 <raigsingh@gmail.com> wrote:
>
> I was successful when using:
> sftp://username:password@hostname
> /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:password@hostname
> /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 <mario@ops.co.at> wrote:
> >
> > Hi!
> > > I am attempting to retrieve the content of a jar resource via sftp
> > with the
> > > following:
> > > jar:sftp://username:password@hostname
> > > /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:password@hostname
> > > /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: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message