Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/phax/phase4.git
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Oct 28, 2021
2 parents d9f0afa + 9130997 commit 169787f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public void handleIncomingSBD (@Nonnull final IAS4IncomingMessageMetadata aMessa
{
final File aFile = StorageHelper.getStorageFile (aMessageMetadata, ".sbd");
if (SimpleFileIO.writeFile (aFile, aSBDBytes).isFailure ())
throw new IllegalStateException ("Failed to write SBD to '" + aFile.getAbsolutePath () + "'");
throw new IllegalStateException ("Failed to write SBD to '" + aFile.getAbsolutePath () + "' (" + aSBDBytes.length + " bytes)");

LOGGER.info ("Wrote SBD to '" + aFile.getAbsolutePath () + "'");
LOGGER.info ("Wrote SBD to '" + aFile.getAbsolutePath () + "' (" + aSBDBytes.length + " bytes)");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ private static void _dumpSoap (@Nonnull final IAS4IncomingMessageMetadata aMessa
new XMLWriterSettings ().setNamespaceContext (Ebms3NamespaceHandler.getInstance ())
.setIndent (EXMLSerializeIndent.INDENT_AND_ALIGN));
if (SimpleFileIO.writeFile (aFile, aBytes).isFailure ())
LOGGER.error ("Failed to write SOAP to '" + aFile.getAbsolutePath () + "'");
LOGGER.error ("Failed to write SOAP to '" + aFile.getAbsolutePath () + "' (" + aBytes.length + " bytes)");
else
LOGGER.info ("Wrote SOAP to '" + aFile.getAbsolutePath () + "'");
LOGGER.info ("Wrote SOAP to '" + aFile.getAbsolutePath () + "' (" + aBytes.length + " bytes)");
}

if (aState.hasUsedCertificate ())
Expand All @@ -85,9 +85,9 @@ private static void _dumpSoap (@Nonnull final IAS4IncomingMessageMetadata aMessa
final String sPEM = CertificateHelper.getPEMEncodedCertificate (aUsedCert);
final byte [] aBytes = sPEM.getBytes (StandardCharsets.US_ASCII);
if (SimpleFileIO.writeFile (aFile, aBytes).isFailure ())
LOGGER.error ("Failed to write certificate to '" + aFile.getAbsolutePath () + "'");
LOGGER.error ("Failed to write certificate to '" + aFile.getAbsolutePath () + "' (" + aBytes.length + " bytes)");
else
LOGGER.info ("Wrote certificate to '" + aFile.getAbsolutePath () + "'");
LOGGER.info ("Wrote certificate to '" + aFile.getAbsolutePath () + "' (" + aBytes.length + " bytes)");
}
}

Expand All @@ -98,9 +98,15 @@ private static void _dumpIncomingAttachment (@Nonnull final IAS4IncomingMessageM
final File aFile = StorageHelper.getStorageFile (aMessageMetadata, ".attachment" + nIndex);
final byte [] aBytes = StreamHelper.getAllBytes (aIncomingAttachment.getInputStreamProvider ());
if (SimpleFileIO.writeFile (aFile, aBytes).isFailure ())
LOGGER.error ("Failed to write Incoming Attachment " + nIndex + " to '" + aFile.getAbsolutePath () + "'");
LOGGER.error ("Failed to write Incoming Attachment " +
nIndex +
" to '" +
aFile.getAbsolutePath () +
"' (" +
aBytes.length +
" bytes)");
else
LOGGER.info ("Wrote Incoming Attachment " + nIndex + " to '" + aFile.getAbsolutePath () + "'");
LOGGER.info ("Wrote Incoming Attachment " + nIndex + " to '" + aFile.getAbsolutePath () + "' (" + aBytes.length + " bytes)");
}

@Nonnull
Expand Down Expand Up @@ -176,8 +182,8 @@ public void processAS4ResponseMessage (@Nonnull final IAS4IncomingMessageMetadat
{
final File aFile = StorageHelper.getStorageFile (aMessageMetadata, ".response");
if (SimpleFileIO.writeFile (aFile, aResponseBytes).isFailure ())
LOGGER.error ("Failed to write response to '" + aFile.getAbsolutePath () + "'");
LOGGER.error ("Failed to write response to '" + aFile.getAbsolutePath () + "' (" + aResponseBytes.length + " bytes)");
else
LOGGER.info ("Wrote response to '" + aFile.getAbsolutePath () + "'");
LOGGER.info ("Wrote response to '" + aFile.getAbsolutePath () + "' (" + aResponseBytes.length + " bytes)");
}
}

0 comments on commit 169787f

Please sign in to comment.