FTP Post Office
Java Software for File Exchanges and Data Interchanges
- Virtual Post Office exchanges files by running on a regular
- Post Office connects computers at different companies using plug-in protocols
- Very Easy to establish interfaces between computers or between
- Capable of generating a new system interface by filling out an
- Open source modules ( IBM and GNU ) are employed
- XML is used extensively for:
- Storage of Network Connection properties
- Storage of file system information involved in data interchange
- Logs of file interchange activity
File Systems existing on various B2B Nodes do not necessarily conform
to a Global Naming Scheme. A configurable policy for renaming at the
"per Topic" and "per business partner" level, combined with flexible
Interfaces and Factory Implementations provides a "pluggable" solution
for filenames as the file based data traverses various nodes.
Server-side demo components, like the sample Web-Service code below
that operates in the PostOffice
pulling just received files off the wire as they were published, and
to a temporary, local directory with new File names, use the
property and the DefaultFileRenamePolicySesn
Class to implement file renames:
You're new Web-App is a shopping cart that's processing tons of
and your fulfillment house is screaming about your choice of email for
delivery of the order data. Email? Fughedit! They want a fully
automated system interface to transmit the Purchase Order files 5 times
a day. With no time,
no money, no resources, you need a Better, Faster, Cheaper Solution for
building the automated interface.
Automated, connection oriented, scheduled movement of files is the core
responsibility of this software. In the time it takes to fill in a Web
Form, you can build your interface, establishing a Virtual Post Office
route that uses a Java client to exchange files and data ( files like
the PO's mentioned above or any other files you share with a business
partner). The properties of the virtual post office route are stored in
an XML file used
by Client software that builds network connections on FTP Protocol and
that sends any new files across the connection. Flexible System
Architecture anticipates that other Net protocols like HTTP or SSH
would be plugged in to replace FTP. Plug-ins remain transparent to the
rest of the application by virtue of their implementation of an
existing Java interface.
The Other Business Problem
Your company has a collection of server's on which is deployed a
collection of Vendor packaged software and home grown applications. As
a perfect example of requirement creep, you discover that a project in
development is creating data files that need to be made available to 3
other systems. Without an existing Enterprise messaging platform, it is
not trivial to tack on the extra work for the Scheduler to run the file
movement scripts. The budget does not exist to write and test these
system interfaces that will actually move the files.
It doesn't even take a programmer to set up a new interface using this
software. A data analyst can complete the registry work to define a new
Topic and a new Subscriber to the topic using 2 simple web forms. Then,
a java client is run as a last step in the script that creates the
data. NO Recompile is needed because the variables relating to the new
interface are handled in Command line parms or in Config files. This
should result in at least a 10 to 1 reduction in cost of new interfaces.
how to use this example
Edit these keys/ values with the root directory where you unpacked the
( in the sample, the application was unpacked to F:\FtpPostOffice_0_8)
- Download and Install
the Project Summary page, find the "latest file
releases" or go
here. The "tar.gz" file can be opened in WinZip by clicking and
- When the file is unpacked you will have the following
- bin - property
files and scripts
- classes - for java
- config - contains
the properties file
- data - for XML
- demo - the Sample Client application is here
- docroot - Web
Module for creating XML files is here
- htdocs - Project
- See index in the htdocs directory to get
- Index of documentation
- htdocs/api/com/borneo -
main Java API documentation for this
- htdocs/api/com/ibm -
IBM open source FTP implementation is used for Connections
- htdocs/api/gnu/regex -
gnu Regular Expressions used to adapt file name filters
- htdocs/jaxb/api -
XML implementation chosen for this project
- lib - for JAR files
- src - java source
code for web module and for main application
- Install the Webmodule located in the %INSTALL_ROOT%/docroot directory.
- The J2EE WAR
file is here if you need to deploy it
- By unpacking the zip file you already unpacked all elements of
the Web app.
- ftpInFile - The XML
file used by Client Application
- ftpOutFile - XML file
written by Client after files moved
- Testing mode: values are
different for ftpInFile and ftpOutFile
- Production mode: value for ftpInFile
and ftpOutFile should be
This is what runs periodically to send files between computers.
- In your IDE or in your J2EE server, install the web app. in the
- Start server
- point your browser to URL below to activate the entry JSP create_file_exchange_session
%server:port% %ServletContext path%/create_file_exchange_session.jsp
- The form for a new interface is pretty self explanatory.
out the form and submit it.
- Field Last File Processed not required when creating
- Handling the http POST is the servlet defined as:
- name= demo
- URL pattern= /demo/*
- Servlet activities include:
- generates JAVA classes for HTTP
request Parameter fields
- XML is generated from the Tree of Java objects and written to
/data directory as file:
- identical XML returned to the browser where it could be saved
- XML file name is from property "ftpOutFile"
- The client will look for the XML using the name specified by
- Rename the XML file if you need to.
- From the sample properties you would rename "ftpjax_new.xml" to
It uses the XML generated by the servlet ( or manually edited XML if
that's your gig )
- In the bin directory Edit file= runftp.bat.
Set the "home" variables to where you installed the software.
- Make sure that you have JDK1.3 or higher
- Set JAVA_HOME
- Set FTPHOME to where you installed the download
- cd into the demo directory
- run the bat file from the demo directory
- after the job runs, your sysout should look like sample output
- debug statements can be removed by setting all "debug" fields to
FAQ in FtpPostOffice Frequent Questions.
XML JAXB API
and auto generation of JAVA classes .
at IBM's open source site.