Skip to content

Commit

Permalink
Fix inputstreams that weren't closed (frankframework#7323)
Browse files Browse the repository at this point in the history
  • Loading branch information
evandongen authored Aug 14, 2024
1 parent 67929c4 commit 6793ecf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public class ReplacingInputStream extends InputStream {
private final byte[] search;
private final InputStream in;

@Override
public void close() throws IOException {
if (this.in != null) {
this.in.close();
}
}

public ReplacingInputStream(InputStream in, String search, String replacement, boolean replaceNonXmlChars,
String nonXmlReplacementCharacter, boolean allowUnicodeSupplementaryCharacters) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public class ReplacingVariablesInputStream extends InputStream {
private final Queue<Integer> outQueue;
private boolean lookingForSuffix = false;

@Override
public void close() throws IOException {
if (this.in != null) {
this.in.close();
}
}

protected ReplacingVariablesInputStream(InputStream in, String variablePrefix, Properties properties) {
this.in = in;
this.variablePrefix = (variablePrefix + "{").getBytes();
Expand Down

0 comments on commit 6793ecf

Please sign in to comment.