Browse Source

figuring out, what is wrong with maven-built jar

lookup-tables
Stephan Richter 5 years ago
parent
commit
7f481974e3
  1. 2
      pom.xml
  2. 5
      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.17</version>
<version>0.11.18</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

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

@ -207,8 +207,11 @@ public class Application extends BaseClass{ @@ -207,8 +207,11 @@ public class Application extends BaseClass{
LOG.debug("requesting file: {}",file);
if (file.exists()) {
LOG.debug("found...");
client.getResponseHeaders().add("Content-Type", Files.probeContentType(file.toPath()));
String ct = Files.probeContentType(file.toPath());
client.getResponseHeaders().add("Content-Type", ct);
LOG.debug("Content-Type: {}",ct);
client.sendResponseHeaders(200, file.length());
LOG.debug("Length: {}",file.length());
OutputStream out = client.getResponseBody();
FileInputStream in = new FileInputStream(file);
in.transferTo(out);

Loading…
Cancel
Save