Timothy E. Archer

System.out.println("Hello World!");

Browsing Posts tagged ftp

By default FTP comes disabled on stock RedHat AS3 and AS4 server installs. For the most part you should not be using it anyways, and instead using something more secure like SFTP. However, in some rare occasions I find the need to enable FTP. Below I will show you how to do it:

  1. Become the root user on your server.
  2. Change to the /etc/xinetd.d directory
    cd /etc/xinetd.d/
    

    continue reading…

Yesterday I introduced how I send files via FTP and SFTP from my java applications. In that post I showed you how to use the Jakarta Commons Net package to FTP files. Today I will show you how to use the JSch (Java Secure Channel) library to do SFTP transfers.

Part 2 of 2 – Using JSch (Java Secure Channel)
First off, what exactly is JSch? Well, the JCraft team describes it says that “JSch allows you to connect to an sshd server and use port forwarding, X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs.” Personally, I’ve only used it to SFTP files, and have not yet used any of its other features.

To use JSch, you’ll first want to download the appropriate libraries from JCraft. Click here to be taken to the JSch homepage and download the jsch library. For my example I downloaded the jsch-0.1.32.jar file directly from their site. Once you download the file, put it in your classpath.

Now just grab the code I present below and go to town. Like the Commons Net library, the JSch library is extremely easy to use!
continue reading…

Within the enterprise applications that I design and develop, a requirement always comes up to integrate it in some way with an external, 3rd party system. For example, in writing an insurance policy management system, the carriers often want policy details FTP’ed to them. Logistics companies typically FTP EDI files around all day. And most recently at the University for which I work, we have integrated our systems to transmit financial aid data to the government, send information related to book store vouchers to our outsourced bookstore, and we have our student data geocoded to help us analyze what profile of students are enrolling. All of these external providers want the data to be FTP’ed to them.

To meet these requirements, I develop most of my data feeds in Java. Java makes it very easy to get data out of a database, package it up into a file, and FTP it off to its destination. Two of the libraries I find very useful to perform the FTP are the Jakarta Commons Net library for standard FTP transfers, and the JSch (Java Secure Channel) library to do SFTP transfers.

In this post I will show you how easy it is to use the Jakarta Commons Net library to perform FTP transfers. My next post will then show you how to use the JSch library to perform SFTP transfers.
continue reading…

Powered by WordPress Web Design by SRS Solutions © 2013 Timothy E. Archer Design by SRS Solutions