summaryrefslogtreecommitdiff
path: root/BKUWebStart/src/main/java/at/gv
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-10-20 17:26:18 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-10-20 18:04:11 +0200
commitc2b94e353bc398d847e25c28ff2210cbc59b6cbe (patch)
tree1feb05a6fec3caefc1e0d3561c6e994caef19e30 /BKUWebStart/src/main/java/at/gv
parent300c3452d7e93cd42c0626310790a6df7c81b846 (diff)
downloadmocca-c2b94e353bc398d847e25c28ff2210cbc59b6cbe.tar.gz
mocca-c2b94e353bc398d847e25c28ff2210cbc59b6cbe.tar.bz2
mocca-c2b94e353bc398d847e25c28ff2210cbc59b6cbe.zip
Move JettyTempCleaner to own module, create signed jar
Diffstat (limited to 'BKUWebStart/src/main/java/at/gv')
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
index 9eaa13b2..19adf571 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Container.java
@@ -57,7 +57,7 @@ public class Container {
public static final String HTTP_PORT_PROPERTY = "mocca.http.port";
public static final String HTTPS_PORT_PROPERTY = "mocca.https.port";
- private static final String JETTY_TEMP_CLEANER_CLASSNAME = "JettyTempCleaner";
+ private static final String JETTY_TEMP_CLEANER_JAR = "JettyTempCleaner.jar";
private static Logger log = LoggerFactory.getLogger(Container.class);
@@ -176,11 +176,11 @@ public class Container {
}
private void copyCleaner(File dir) throws IOException {
- File cleanerClass = new File(dir, JETTY_TEMP_CLEANER_CLASSNAME + ".class");
- log.debug("copying JettyTempCleaner to " + cleanerClass);
- InputStream is = getClass().getClassLoader().getResourceAsStream(JETTY_TEMP_CLEANER_CLASSNAME + ".class");
+ File cleanerJar = new File(dir, JETTY_TEMP_CLEANER_JAR);
+ log.debug("copying JettyTempCleaner to " + cleanerJar);
+ InputStream is = getClass().getClassLoader().getResourceAsStream(JETTY_TEMP_CLEANER_JAR);
OutputStream os;
- os = new BufferedOutputStream(new FileOutputStream(cleanerClass));
+ os = new BufferedOutputStream(new FileOutputStream(cleanerJar));
new StreamCopier(is, os).copyStream();
os.close();
}
@@ -198,11 +198,12 @@ public class Container {
copyCleaner(userDir);
List<String> args = new ArrayList<String>();
args.add("java");
- args.add(JETTY_TEMP_CLEANER_CLASSNAME);
+ args.add("-jar");
+ args.add(JETTY_TEMP_CLEANER_JAR);
args.add(tempDir.getAbsolutePath());
ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(userDir);
- log.debug("Starting " + JETTY_TEMP_CLEANER_CLASSNAME + " to remove " + tempDir.getAbsolutePath());
+ log.debug("Starting " + JETTY_TEMP_CLEANER_JAR + " to remove " + tempDir.getAbsolutePath());
pb.start();
} catch (IOException e) {
log.error("Failed to copy jetty temp cleaner", e);