Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Client to telnet into server and then ftp to another server

Thread view: 
Marlo - 08 Aug 2006 11:23 GMT
Hi

I am trying to write a java client that connects to a ftp server.
The trick is that the ftp server has a  private IP and is sitting
behind a Telnet server with a public IP address.

How can I go about implementing this client? [I already have the ftp
client working.].
The idea is first to connect via telnet, then connect to the ftp server
and then download/upload files.

Can I use TelnetInputStream or what other sugesstions do you have?

Thanks,
Marlo
Chris - 09 Aug 2006 03:24 GMT
> Hi
>
[quoted text clipped - 11 lines]
> Thanks,
> Marlo

I haven't done this, but it should theoretically be possible. I'd start
with a telnet client and see if you can feed it text strings and get
responses just as if you were sitting at a telnet terminal. Once you get
that working, just use a command line ftp client on the telnet server.
Download files to the telnet server, and then to the client from there.
Streaming it in one go might be trickier.
Gordon Beaton - 09 Aug 2006 07:57 GMT
> I am trying to write a java client that connects to a ftp server.
> The trick is that the ftp server has a private IP and is sitting
[quoted text clipped - 3 lines]
> client working.]. The idea is first to connect via telnet, then
> connect to the ftp server and then download/upload files.

I know this isn't a direct answer to your question, but it might help
you find a better solution to your problem.

It sounds to me like you're trying to transfer files between two
hosts, neither of which is your localhost. It might be worth knowing
that the FTP protocol already supports this kind of transfer, i.e. an
FTP client on one host can be used to transfer files directly between
two other hosts, without the files passing the client host.

All that's required is that the client establish control connections
to each of the remote hosts. It's described in the RFC, in particular
figure 2 and section 5.2.

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Marlo - 09 Aug 2006 18:48 GMT
> > I am trying to write a java client that connects to a ftp server.
> > The trick is that the ftp server has a private IP and is sitting
[quoted text clipped - 22 lines]
> [ don't email me support questions or followups ]
> g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Thanks for your reply. I came accross this website,
http://www.rfc-archive.org/getrfc.php?rfc=1415, which I think is the
one you were referring to. I am not familiar with the FTAM protocol. So
I will have to really read up on it to determine whether I can
implement this option.

Question : FTAM does not seem like a very popular protocol. How
difficult do you think will it be to program the FTP-FTAM gateway for a
java developer like me, with 1 year's experience? Bearing in mind that
I have less than a month to familiarise myself with this  specification
and to code it?
Gordon Beaton - 09 Aug 2006 19:13 GMT
> Thanks for your reply. I came accross this website,
> http://www.rfc-archive.org/getrfc.php?rfc=1415, which I think is the
[quoted text clipped - 7 lines]
> mind that I have less than a month to familiarise myself with this
> specification and to code it?

I was referring to regular FTP, and the RFC number (rfc959) got lost
while I was editing my post.

Here it is:
http://www.ietf.org/rfc/rfc959.txt

You mentioned that you'd already implemented an FTP client, so I don't
suppose it should be a great deal of work to use it as described in
section 5.2.

There are also a number of open source FTP client libraries for Java,
(for example http://jakarta.apache.org/commons/net/) so there's really
no need to invent your own.

See also:
http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Marlo - 11 Aug 2006 13:07 GMT
> > Thanks for your reply. I came accross this website,
> > http://www.rfc-archive.org/getrfc.php?rfc=1415, which I think is the
[quoted text clipped - 30 lines]
> [ don't email me support questions or followups ]
> g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Thanks for the link. I'll read through it and then try to integrate my
client.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.