Skip to content

Commit

Permalink
Merge pull request #28 from branch 'Absurd-Mind-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
rsandell committed Aug 7, 2017
2 parents e400dda + a531549 commit ff27af9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Expand Up @@ -31,6 +31,8 @@
import org.jenkinsci.plugins.workflow.steps.StepContextParameter;

import javax.inject.Inject;

import java.io.InputStream;
import java.io.PrintStream;
import java.io.StringReader;
import java.util.HashMap;
Expand Down Expand Up @@ -65,7 +67,7 @@ protected Map<String, Object> run() throws Exception {
FilePath f = ws.child(step.getFile());
if (f.exists() && !f.isDirectory()) {
try(InputStream is = f.read()){
properties.load(is);
properties.load(is);
}
} else if (f.isDirectory()) {
logger.print("warning: ");
Expand Down
Expand Up @@ -37,6 +37,7 @@
import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.jar.Manifest;

Expand Down Expand Up @@ -96,8 +97,10 @@ private SimpleManifest parseFile(String file) throws IOException, InterruptedExc
return parseText(text);
}
} else {
Manifest manifest = new Manifest(path.read());
return new SimpleManifest(manifest);
try (InputStream is = path.read()) {
Manifest manifest = new Manifest(is);
return new SimpleManifest(manifest);
}
}
}
}
Expand Up @@ -43,6 +43,7 @@
import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -123,7 +124,9 @@ protected Model run() throws Exception {
if (path.isDirectory()) {
throw new FileNotFoundException(path.getRemote() + " is a directory.");
}
return new MavenXpp3Reader().read(path.read());
try (InputStream is = path.read()) {
return new MavenXpp3Reader().read(is);
}
}
}

Expand Down

0 comments on commit ff27af9

Please sign in to comment.