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 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId> <groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId> <artifactId>web4rail</artifactId>
<version>0.11.16</version> <version>0.11.17</version>
<name>Web4Rail</name> <name>Web4Rail</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>Java Model Railway Control</description> <description>Java Model Railway Control</description>

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

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

Loading…
Cancel
Save