Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Added output file as param of EVENT_END_FILE_PROCESSING progress event. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/fmpp/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public class Engine {
private boolean parametersLocked;

// Session state
private File of = null;
private Map ignoredDirCache = new HashMap();
private Set processedFiles = new HashSet();

Expand Down Expand Up @@ -790,14 +791,14 @@ private boolean processFile(File sf, File df, boolean allowOutFAdj)
this,
ProgressListener.EVENT_END_FILE_PROCESSING,
sf, pmode,
e, null);
e, of);
}
if (catchedExc == null) {
progListeners.notifyProgressEvent(
this,
ProgressListener.EVENT_END_FILE_PROCESSING,
sf, pmode,
null, null);
null, of);
} else {
// OutOfMemoryError-s can cause Java applications to enter an
// inconsistent state, so it's better stop the session.
Expand Down Expand Up @@ -826,6 +827,7 @@ private void executeFile(File sf, File df)
templateEnv.execute(template, out, sf, null, null, null);
done = true;
} finally {
of = out.getOutputFile();
out.close(!done);
}
}
Expand Down