• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

FTP using java

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Does java supports using FTP?

Actually I am trying to get data from different Windows NT machines to UNIX box using java, Please provide me with some idea on this.

Thanks in advance,

Ramesh.
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ramesh,

We use the apache commons net package. http://jakarta.apache.org/commons/net/

The code is simple to implement, here is a sample:

// Connect and logon to FTP Server
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(username, password);

// Change to the directory
ftp.changeWorkingDirectory(folder);

FileInputStream src2 = new FileInputStream(outFile);
ftp.storeFile(filename,src2 );
src2.close();
ftp.logout();
ftp.disconnect();

Hope this helps,

Julia
 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my favorite site. Plus the site has a lot of examples:
http://www.jscape.com/inetfactory/index.html
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic