|
Bill - I tried my code with setUserDirIsRoot set to true, and alsowrote:
tried false. Neither worked. I looked into subclassing
FtpFileSystemConfigBuilder, but it is only a transfer object used to
store config settings. It does not connect to the FTP server or do any
communication. Any other suggestions?
Thanks,
Sarah
On Tue, Oct 14, 2008 at 4:18 PM, Blalock, Bill <Bill.Blalock@xxxxxxxx>
CURLIB.Hey Sarah:
I got curious and checked out the Apache VFS site.
You might try changing
FtpFileSystemConfigBuilder.getInstance().To "false".
setUserDirIsRoot(fileSystemOptions, true);
According to the javadocs this method
> use user directory as root (do not change to fs root)
I think "true" is telling the FTP server to put the file in the
root.
"false" might tell the FTP server to put the file relative to the
suggests).That might cause a CD and force NAMEFMT to change (as Tamas
(e.g.
The real solution would be to subclass FtpFileSystemConfigBuilder for
the i5 FTP server ;)
Let us know if that works please.
Bill Blalock
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tamas Perlaky
Sent: Tuesday, October 14, 2008 3:23 PM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Using Apache VFS to FTP to the AS/400 IFS
Hi Sarah,
Since you're not using FTP directly (i.e. with VFS as an intermediate
layer) your only option may be to change the system default to *PATH
naming (NAMEFMT 1) via the CHGFTPA command. Of course this may break
other things which expect *SYS naming (NAMEFMT 0) so be sure to check
with any appropriate parties first.
If you were using a different FTP client you might be able to use an
FTP site command to issue a literal SITE NAMEFMT 1 to the FTP server
to effect this switch. This may somehow be possible with VFS but I'm
not familiar with it at all so I can't make a recommendation there.
Another trick would be to force the first command of your FTP session
to be a CD such that the directory specified starts with a slash
software's"CD /home/aplsup"), in which case the leading slash would trigger an
implicit switch to *PATH naming for that session...
If you're looking for an FTP client library I can recommend jScape's
(commercial license) which I quite like. I've also used /n
confidential. If you are not the(also commercial), which I quite dislike.
t.
On 14-Oct-08, at 1:36 PM, Sarah Poger Gladstone wrote:
I have been using the Apache VFS API's to upload to Unix FTP serversFileSystemOptions();
successfully. But I am unable to upload to the IFS on my AS/400. I
can upload to QGPL, but not the IFS.
Below is an excerpt from my Java code:
FileSystemManager mgr;
try {
mgr = VFS.getManager();
FileSystemOptions fileSystemOptions;
FileSystemOptions opts = new
fileSystemOptions = opts;"C:\\sgladstone\\edfiles\\mydata.txt";
FtpFileSystemConfigBuilder
.getInstance().setUserDirIsRoot(fileSystemOptions,
true);
String strLocalFile =
FileObject foLocalFile =mgr.resolveFile(strLocalFile);
String rUrlStr =rUrlStr, opts);
"ftp://myusername:mypassword@myas400/home/aplsup/sarahtest.txt" ;
FileObject foRemoteFile = mgr.resolveFile(
FileSelector fS = Selectors.SELECT_SELF ;
foRemoteFile.copyFrom(foLocalFile, fS);
When I run this code, it throws the exception:
Caused by: org.apache.commons.vfs.FileSystemException: Could not
create FTP directory "ftp://myusername:mypassword@myas400/home"
I think this issue is caused by the AS/400 trying to use System
naming, instead of using NAMEFMT=1.
Any ideas of how to get the VFS APIs to get the AS/400 to switch to
NAMEFMT =1 ?
Thanks,
Sarah
--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
_____________
The information contained in this message is proprietary and/or
(ii) do not disclose,intended recipient, please: (i) delete the message and all copies;
sender immediately. In addition,distribute or use the message in any manner; and (iii) notify the
to archiving and review byplease be aware that any message addressed to our domain is subject
(JAVA400-L) mailing listpersons other than the intended recipient. Thank you.
_____________
--
This is the Java Programming on and around the iSeries / AS400
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.