Browse Source

figuring out, what is wrong with maven-built jar

lookup-tables
Stephan Richter 5 years ago
parent
commit
56d19ddcf1
  1. 2
      pom.xml
  2. 2
      src/main/java/de/srsoftware/web4rail/Application.java

2
pom.xml

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>0.11.16</version>
<version>0.11.17</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

2
src/main/java/de/srsoftware/web4rail/Application.java

@ -206,6 +206,7 @@ public class Application extends BaseClass{ @@ -206,6 +206,7 @@ public class Application extends BaseClass{
File file = new File(System.getProperty("user.dir")+"/resources"+uri);
LOG.debug("requesting file: {}",file);
if (file.exists()) {
LOG.debug("found...");
client.getResponseHeaders().add("Content-Type", Files.probeContentType(file.toPath()));
client.sendResponseHeaders(200, file.length());
OutputStream out = client.getResponseBody();
@ -217,6 +218,7 @@ public class Application extends BaseClass{ @@ -217,6 +218,7 @@ public class Application extends BaseClass{
out.close();
return;
}
LOG.debug("not found...");
sendError(client,404,t("Could not find \"{}\"",uri));
}

Loading…
Cancel
Save