Use this Java program interface to include the following openFT functions in the Java programs you create:
synchronous file transfer
asynchronous file transfer
administer and delete asynchronous file transfer requests
transmit file attributes in remote systems
create directories in remote systems
delete files or file directories in remote systems
execute commands in remote systems
These functions are available to openFT users and can be used in Java programs to automate procedures.
Before you can use the Java program interface, the J2SETM Runtime Environment 8.0 or higher must be installed on your system.
You will find the Java Docs in the following directory:/opt/openFT/java/doc
(Unix systems)
openFT-installation-directory\java\doc
(Windows systems)
In terms of functionality, the Java-API corresponds to the C-API, see chapter “Description of the C functions”. Structure versions are not specified in Java and are automatically administered via the method setApiVersion.
Translating and calling programs
To translate your program, you must extend the class path in such a way that it contains the following file:/opt/openFT/java/openFTapi.jar
(Unix systems)
openFT-installation-directory\java\openFTapi.jar
(Windows systems)
The archive openFTapi.jar will also be needed for the program to run, in addition to the java.library.path under /opt/openFT/java (Unix systems) or openFT-installation-directory\bin (Windows systems).
On Unix platforms with a 64-bit library, it may also be necessary to specify the option –d64 when calling the program.
After installing openFT, you will find sample programs (Sample[1..5].java) in the following directory: /opt/openFT/samples/java (
Unix systems)
openFT-installation-directory\samples\java
(Windows systems)
The functionality of the samples corresponds to the functionality of the samples described in chapter “Sample programs”.
Example
Translating the sample and running the program Sample1.java:
For Windows systems, this example presumes that openFT is installed under C:\Program Files\openFT.
Copying Sample1.java into the current directory
Unix systems:cp /opt/openFT/samples/java/Sample1.java .
Windows systems:
copy "c:\Program Files\openFT\samples\java\Sample1.java" .
Translating Sample1.java
Unix systems:javac -classpath /opt/openFT/java/openFTapi.jar Sample1.java
Windows systems:
javac -classpath "c:\Program Files\openFT\java\openFTapi.jar" Sample1.java
Running Sample1.class
Unix systems:java -cp /opt/openFT/java/openFTapi.jar:. \
-Djava.library.path=/opt/openFT/java Sample1 dat1 dat2
Windows systems:java -cp "c:\Program Files\openFT\java\openFTapi.jar";. \ -Djava.library.path="c:\Program Files\openFT\bin" Sample1 dat1 dat2