Class AS4RawResponseConsumerWriteToFile

All Implemented Interfaces:
com.helger.base.trait.IGenericImplTrait<AS4RawResponseConsumerWriteToFile>, IAS4RawResponseConsumer

public class AS4RawResponseConsumerWriteToFile extends AbstractAS4RawResponseConsumer<AS4RawResponseConsumerWriteToFile>
Example implementation of IAS4RawResponseConsumer writing to a file.
Author:
Philip Helger
  • Constructor Details

  • Method Details

    • getFileOpenCallback

      public final @Nullable Consumer<? super File> getFileOpenCallback()
      Returns:
      The optional callback that is invoked for every file that is opened. This may be used to grab the effective filename. May be null.
      Since:
      1.4.1
    • setFileOpenCallback

      public final @NonNull AS4RawResponseConsumerWriteToFile setFileOpenCallback(@NonNull Consumer<? super File> aFileOpenCallback)
      Set the callback to be invoked every time a File is opened for writing.
      Parameters:
      aFileOpenCallback - The callback to be used. May be null.
      Returns:
      this for chaining
      Since:
      1.4.1
    • handleResponse

      public void handleResponse(@NonNull AS4ClientSentMessage<byte[]> aResponseEntity) throws Phase4Exception
      Description copied from interface: IAS4RawResponseConsumer
      Handling a HTTP response
      Parameters:
      aResponseEntity - The response message in relation to the source message
      Throws:
      Phase4Exception - In case of error.
    • createForDirectory

      public static @NonNull AS4RawResponseConsumerWriteToFile createForDirectory(@NonNull File aBaseDirectory)
      Create a new instance for the provided directory.
      Parameters:
      aBaseDirectory - The absolute directory to be used. May not be null.
      Returns:
      The created instance. Never null.
      Since:
      0.10.2