Off-topic Talk Where overpaid, underworked S2000 owners waste the worst part of their days before the drive home. This forum is for general chit chat and discussions not covered by the other off-topic forums.

Connecting/logging/interacting with an FTP site using Java ?

Thread Tools
 
Old Apr 10, 2003 | 08:23 AM
  #1  
s2kdriver80's Avatar
Thread Starter
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Nov 2002
Posts: 2,048
Likes: 8
From: Long Island, New York, US
Default Connecting/logging/interacting with an FTP site using Java ?

There is an FTP server where I work that is within the company network. Clients send us files to our FTP server and our program routes files to certain locations within the network. Currently, I reference and access the FTP machine through mapped drives (i.e. drive letters) - that's how I access the files. But, now they're looking to have the FTP hosted (outsourced) since we've been having way too many network interruptions and trouble with our FTP in general. Herein lies my problem - since the FTP server would be outsourced and outside of our network, I no longer can access the machine through mapped drives but would have to make a program to log onto an FTP site remotely (across the internet using name/password etc) to access files that clients send us. I've looked in the standard Java API and it doesn't seem like there are any standard FTP connection classes in the JDK. The original option would have to be building it from scratch which probably would have to deal with socket/port programming which I really have no clue about.

Has anyone done something like this before? Are there standard (not contained in the standard Java API) open source classes that serve such a purpose? Thanks.
Reply
Old Apr 10, 2003 | 08:41 AM
  #2  
PeaceLove&S2K's Avatar
20 Year Member
 
Joined: Jul 2002
Posts: 19,257
Likes: 19
From: San Diego, CA
Default

It's not part of the standard java package, but Sun does provide it. In a package called sun.net.ftp or com.sun.net.ftp or something like that. I used it once before, but couldn't find my old class for some reason. Let me continue looking around.

FTP protocol (active) is not something you really want to manually do yourself with sockets programming. Too tedious.
Reply
Old Apr 10, 2003 | 08:49 AM
  #3  
PeaceLove&S2K's Avatar
20 Year Member
 
Joined: Jul 2002
Posts: 19,257
Likes: 19
From: San Diego, CA
Default

http://www.experts-exchange.com/Programmin...Q_20421069.html

This might be helpful. I found my code, but nothing useful there really. I think sun.net.ftp.FtpClient doesn't let you delete files though, 'cos I subclassed it and added a "delete" method (don't see why I'd have done that if the super class did it out of the box).
Reply
Old Apr 10, 2003 | 08:56 AM
  #4  
PeaceLove&S2K's Avatar
20 Year Member
 
Joined: Jul 2002
Posts: 19,257
Likes: 19
From: San Diego, CA
Default

Oh, and it comes with jdk (1.3.1 and 1.4.1 these are the two version I have locally).
Reply
Old Apr 10, 2003 | 10:03 AM
  #5  
1a-race's Avatar
Banned
 
Joined: May 2002
Posts: 1,519
Likes: 0
From: Philly
Default

what is wrong with accessing it by username/password in internet explorer?
Reply
Old Apr 10, 2003 | 10:08 AM
  #6  
RiceBurnerTX's Avatar
Registered User
 
Joined: Dec 2002
Posts: 1,505
Likes: 0
From: Austin
Default

You may also look into thrid party APIs. I used the Netscape libraires to build up email functionalities in pieces of software I've used in the past. There are tons of open source libraries that can help you. You may just have to install the client software on your machine and run hooks into it from your application. If they (your client) aren't against it you could also look into using the http/s to transfer the files.

Rice
Reply
Old Apr 10, 2003 | 10:12 AM
  #7  
1a-race's Avatar
Banned
 
Joined: May 2002
Posts: 1,519
Likes: 0
From: Philly
Default

I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
Reply

Trending Topics

Old Apr 10, 2003 | 10:26 AM
  #8  
RiceBurnerTX's Avatar
Registered User
 
Joined: Dec 2002
Posts: 1,505
Likes: 0
From: Austin
Default

Originally posted by 1a-race
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.
I'm assuming the ftp/copy process is only part of the application he is building. If not then, you can even map ftp drives in windows2000. If you are just looking to browse the server I would agree with 1a-race, I think you're making it more difficult then you have to

Rice
Reply
Old Apr 10, 2003 | 10:30 AM
  #9  
foolio's Avatar
Registered User
 
Joined: Sep 2001
Posts: 565
Likes: 1
From: SF Bay Area
Default

Originally posted by 1a-race
I am not exactly sure of why you need to make a program to log onto an ftp site when all you have to do is type ftp://blahblahblah in your address bar then enter username/password.

You can even use ftp://user:mypassword@blah.blah.blah so you don't have to type user/pw each time.
Reply
Old Apr 10, 2003 | 10:48 AM
  #10  
1a-race's Avatar
Banned
 
Joined: May 2002
Posts: 1,519
Likes: 0
From: Philly
Default

I believe if you do it that way it also gets added into my network places.
Reply



All times are GMT -8. The time now is 01:13 PM.