Skip to content

Commit

Permalink
Better temp file handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed May 2, 2017
1 parent 7d895a0 commit e411e40
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.sinistral</groupId>
<artifactId>proteus-core</artifactId>
<version>0.1.1</version>
<version>0.1.2-SNAPSHOT</version>
<name>proteus core</name>
<description>Proteus is an extremely light, fast, and flexible Java REST API framework built atop Undertow.</description>
<url>http://github.com/noboomu/proteus</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -252,7 +253,9 @@ public void generateSwaggerHTML()

try(JarFile jarFile = new JarFile(srcFile, false))
{
Path tmpDirParent = Paths.get(config.getString("application.tmpdir"));
String appName = config.getString("application.name").replaceAll(" ", "_");

Path tmpDirParent = Files.createTempDirectory(appName);

Path swaggerTmpDir = tmpDirParent.resolve("swagger/");

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ application {

name="proteus"
# tmpdir
tmpdir = ${java.io.tmpdir}/${application.name}
tmpdir =${java.io.tmpdir}

# path (a.k.a. as contextPath)
path = "/v1"
Expand Down

0 comments on commit e411e40

Please sign in to comment.