Skip to content

Commit

Permalink
Fix lgtm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bpross-52n committed May 27, 2019
1 parent ae3fe7e commit 6c420dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -300,8 +300,10 @@ private void persist(Path directory,

Encoder base64encoder = Base64.getEncoder();

OutputStream outputStream = base64encoder.wrap(new FileOutputStream(outputFile.toFile()));
IOUtils.copy(in, outputStream);
try (OutputStream outputStream = base64encoder.wrap(new FileOutputStream(outputFile
.toFile()))) {
IOUtils.copy(in, outputStream);
}
}

} else {
Expand Down
3 changes: 3 additions & 0 deletions engine/src/main/java/org/n52/javaps/utils/IOUtils.java
Expand Up @@ -179,6 +179,9 @@ public static List<File> unzipAll(File file) throws IOException {
try (ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(new FileInputStream(file)))) {
while ((entry = zipInputStream.getNextEntry()) != null) {
entryFile = new File(tempDir, entry.getName());
if (!file.toPath().normalize().startsWith(tempDir.toPath())) {
throw new IOException("Bad zip entry: " + entry.getName());
}
boolean created = entryFile.createNewFile();
if (!created) {
LOGGER.info("File already exists: " + entryFile.getAbsolutePath());
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/main/webapp/static/index.html
Expand Up @@ -40,11 +40,10 @@ <h2>Test requests</h2>
</main>

<footer>
<p>Powered by <a href="https://github.com/52North/iceland" title="iceland website">iceland</a> from <a href="http://52north.org" title="52°North website">52&deg;North</a>.</p>
<p>Powered by <a href="https://github.com/52North/arctic-sea" title="arctic-sea website">arctic-sea</a> from <a href="http://52north.org" title="52°North website">52&deg;North</a>.</p>
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
Expand Down

0 comments on commit 6c420dc

Please sign in to comment.