Class AS4RawResponseConsumerWriteToFile

All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<AS4RawResponseConsumerWriteToFile>, IAS4RawResponseConsumer

public class AS4RawResponseConsumerWriteToFile extends AbstractAS4RawResponseConsumer<AS4RawResponseConsumerWriteToFile>
Example implementation of IAS4RawResponseConsumer writing to a file. Was moved to this package from com.helger.phase4.servlet.dump in v1.3.0.
Author:
Philip Helger
  • Constructor Details

  • Method Details

    • getFileOpenCallback

      @Nullable public final 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

      @Nonnull public final 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

      @Nonnull public static 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