Skip navigation links
ApplinX 10.5.0.0000 API Specification

Package com.sabratec.util.ftp

This package supplies an API for the ApplinX FTP mechanism.
It can be used instead of using the FTP dialog screens.
The main class in the package is GXFtpManager.
This is a singletone class and it can be accessed
only via the instance() method.

Another important class is GXFtpRequest,
which is a data structure that contains all the relevant infomation for the FTP transmission.

Below are two code examples of uploading and downloading files:

Code sample for uploading a file to a Mainframe host:
  GXFtpRequest uploadReq = new GXFtpRequest();
  uploadReq.setUser(user);
  uploadReq.setPassword(pass);
  uploadReq.setServer(host ip address);
  uploadReq.setRemoteFile(remote file using full path);
  uploadReq.setValue(GXMFCommands.CMD_MF_DATA_TYPE, GXMFCommands.CMD_VAL_MF_DATA_TYPE_BIN)
  try {
  uploadReq.readFileToUpload(local file using full path);
  GXFtpManager.instance().putFile(uploadReq);
  } catch (GXGeneralException e) {
  e.printStackTrace();
  }
 


Code sample for downloading a file from a Mainframe host:
  GXFtpRequest downloadReq = new GXFtpRequest();
  downloadReq.setUser(user);
  downloadReq.setPassword(pass);
  downloadReq.setServer(host ip address);
  downloadReq.setRemoteFile(remote file using full path);
  downloadReq.setValue(GXMFCommands.CMD_MF_DATA_TYPE, GXMFCommands.CMD_VAL_MF_DATA_TYPE_BIN);
  try {
  GXFtpResponse resp = GXFtpManager.instance().getFile(downloadReq);
  resp.writeFileToDisk(local file using full path);
  } catch (GXFtpException e) {
  e.getMessage();
  }

See: Description

  • Class Summary 
    Class Description
    GXFtpConsts  
    GXFtpException
    Exception thrown when unexpected or negative reply is received from the server.
    GXFtpManager
    This class supplies a batch API for the ApplinX FTP mechanism.
    GXFtpRequest
    This class is used as a data structure for all the parameters which are relevant
    for an FTP transmission.
    GXFtpResponse
    This class holds the data retrieved from an FTP download request.
    GXFtpTypes  

Package com.sabratec.util.ftp Description

This package supplies an API for the ApplinX FTP mechanism.
It can be used instead of using the FTP dialog screens.
The main class in the package is GXFtpManager.
This is a singletone class and it can be accessed
only via the instance() method.

Another important class is GXFtpRequest,
which is a data structure that contains all the relevant infomation for the FTP transmission.

Below are two code examples of uploading and downloading files:

Code sample for uploading a file to a Mainframe host:
  GXFtpRequest uploadReq = new GXFtpRequest();
  uploadReq.setUser(user);
  uploadReq.setPassword(pass);
  uploadReq.setServer(host ip address);
  uploadReq.setRemoteFile(remote file using full path);
  uploadReq.setValue(GXMFCommands.CMD_MF_DATA_TYPE, GXMFCommands.CMD_VAL_MF_DATA_TYPE_BIN)
  try {
  uploadReq.readFileToUpload(local file using full path);
  GXFtpManager.instance().putFile(uploadReq);
  } catch (GXGeneralException e) {
  e.printStackTrace();
  }
 


Code sample for downloading a file from a Mainframe host:
  GXFtpRequest downloadReq = new GXFtpRequest();
  downloadReq.setUser(user);
  downloadReq.setPassword(pass);
  downloadReq.setServer(host ip address);
  downloadReq.setRemoteFile(remote file using full path);
  downloadReq.setValue(GXMFCommands.CMD_MF_DATA_TYPE, GXMFCommands.CMD_VAL_MF_DATA_TYPE_BIN);
  try {
  GXFtpResponse resp = GXFtpManager.instance().getFile(downloadReq);
  resp.writeFileToDisk(local file using full path);
  } catch (GXFtpException e) {
  e.getMessage();
  }
ApplinX API Specification

Copyright 2018 Software AG. All rights reserved. Use is subject to license terms.