Class FileTransfer

java.lang.Object
org.kopi.ebics.client.FileTransfer

public class FileTransfer extends Object
Handling of file transfers. Files can be transferred to and fetched from the bank. Every transfer may be performed in a recoverable way. For convenience and performance reasons there are also methods that do the whole transfer in one method call. To use the recoverable transfer mode, you may set a working directory for temporarily created files.

EBICS specification 2.4.2 - 6.2 Encryption at application level

In the event of an upload transaction, a random symmetrical key is generated in the customer system that is used exclusively within the framework of this transaction both for encryption of the ES’s and for encryption of the order data. This key is encrypted asymmetrically with the financial institution’s public encryption key and is transmitted by the customer system to the bank system during the initialization phase of the transaction.

Analogously, in the case of a download transaction a random symmetrical key is generated in the bank system that is used for encryption of the order data that is to be downloaded and for encryption of the bank-technical signature that has been provided by the financial institution. This key is asymmetrically encrypted and is transmitted by the bank system to the customer system during the initialization phase of the transaction. The asymmetrical encryption takes place with the technical subscriber’s public encryption key if the transaction’s EBICS messages are sent by a technical subscriber. Otherwise the asymmetrical encryption takes place with the public encryption key of the non-technical subscriber, i.e. the submitter of the order.

  • Constructor Details

    • FileTransfer

      public FileTransfer(EbicsSession session)
      Constructs a new FileTransfer session
      Parameters:
      session - the user session
  • Method Details

    • sendFile

      public void sendFile(byte[] content, EbicsOrderType orderType, EbicsUploadParams params) throws IOException, EbicsException
      Initiates a file transfer to the bank.
      Parameters:
      content - The bytes you want to send.
      orderType - As which order type
      Throws:
      IOException
      EbicsException
    • sendFile

      public void sendFile(ContentFactory factory, int segmentNumber, boolean lastSegment, byte[] transactionId, EbicsOrderType orderType) throws IOException, EbicsException
      Sends a segment to the ebics bank server.
      Parameters:
      factory - the content factory that contain the segment data.
      segmentNumber - the segment number
      lastSegment - is it the last segment?
      transactionId - the transaction id
      orderType - the order type
      Throws:
      IOException
      EbicsException
    • fetchFile

      public void fetchFile(EbicsOrderType orderType, File outputFile) throws IOException, EbicsException
      Fetches a file of the given order type from the bank. You may give an optional start and end date. This type of transfer will run until everything is processed. No transaction recovery is possible.
      Parameters:
      orderType - type of file to fetch
      outputFile - where to put the data
      Throws:
      IOException - communication error
      EbicsException - server generated error
    • fetchFile

      public void fetchFile(EbicsOrderType orderType, EbicsDownloadParams downloadParams, File outputFile) throws IOException, EbicsException
      Fetches a file of the given order type from the bank. This type of transfer will run until everything is processed. No transaction recovery is possible.
      Parameters:
      orderType - type of file to fetch
      downloadParams - optional EBICS 3.0 service parameters and report period
      outputFile - where to put the data
      Throws:
      IOException - communication error
      EbicsException - server generated error
    • fetchFile

      public void fetchFile(EbicsOrderType orderType, int segmentNumber, boolean lastSegment, byte[] transactionId, Joiner joiner) throws IOException, EbicsException
      Fetches a given portion of a file.
      Parameters:
      orderType - the order type
      segmentNumber - the segment number
      lastSegment - is it the last segment?
      transactionId - the transaction ID
      joiner - the portions joiner
      Throws:
      IOException - communication error
      EbicsException - server generated error