Skip to content

Commit

Permalink
Fix formatting and reference pending file directory using string static
Browse files Browse the repository at this point in the history
  • Loading branch information
uhurusurfa committed Oct 2, 2024
1 parent 29e1997 commit 6033022
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.openas2.params.ParameterParser;
import org.openas2.params.RandomParameters;
import org.openas2.partner.Partnership;
import org.openas2.processor.Processor;
import org.openas2.processor.resender.ResenderModule;
import org.openas2.processor.sender.SenderModule;
import org.openas2.util.AS2Util;
Expand Down Expand Up @@ -233,6 +234,9 @@ protected Message processDocument(File pendingFile, Message msg) throws OpenAS2E
getSession().getProcessor().handle(SenderModule.DO_SEND, msg, options);
// Cleanup files only if sending was successful and an MDN was already received
if (!msg.isResend() && !msg.isConfiguredForAsynchMDN()) {
if (logger.isDebugEnabled()) {
logger.debug("Calling AS2Util.cleanupFiles from processDocument method.");
}
AS2Util.cleanupFiles(msg, false);
}
} catch (Exception e) {
Expand Down Expand Up @@ -291,7 +295,7 @@ public void addMessageMetadata(Message msg, String filename) throws OpenAS2Excep
msg.setHeader("AS2-From", msg.getPartnership().getSenderID(Partnership.PID_AS2));
// Now build the filename since it is by default dependent on having sender and
// receiver ID
String pendingFile = AS2Util.buildPendingFileName(msg, getSession().getProcessor(), "pendingmdn");
String pendingFile = AS2Util.buildPendingFileName(msg, getSession().getProcessor(), Processor.PENDING_MDN_MSG_DIRECTORY_IDENTIFIER);
msg.setAttribute(FileAttribute.MA_PENDINGFILE, pendingFile);
CompositeParameters parser = new CompositeParameters(false).add("date", new DateParameters()).add("msg", new MessageParameters(msg)).add("rand", new RandomParameters());
msg.setAttribute(FileAttribute.MA_ERROR_DIR, ParameterParser.parse(getParameter(PARAM_ERROR_DIRECTORY, true), parser));
Expand Down

0 comments on commit 6033022

Please sign in to comment.