summaryrefslogtreecommitdiff
path: root/JettyTempCleaner/src
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-03-31 13:32:52 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-03-31 13:36:42 +0200
commitd461df21260cc8d5dbc07c1015a24eb41f31fc99 (patch)
tree644af51e0af854172ffea544799e0aa7b456b21d /JettyTempCleaner/src
parent1209004fcf681f1b3cf1272458f7ee3110fde961 (diff)
downloadmocca-d461df21260cc8d5dbc07c1015a24eb41f31fc99.tar.gz
mocca-d461df21260cc8d5dbc07c1015a24eb41f31fc99.tar.bz2
mocca-d461df21260cc8d5dbc07c1015a24eb41f31fc99.zip
Get rid of JettyTempCleaner, simply delete on next start
Diffstat (limited to 'JettyTempCleaner/src')
-rw-r--r--JettyTempCleaner/src/main/java/JettyTempCleaner.java57
-rw-r--r--JettyTempCleaner/src/site/apt/index.apt12
-rw-r--r--JettyTempCleaner/src/site/site.xml42
3 files changed, 0 insertions, 111 deletions
diff --git a/JettyTempCleaner/src/main/java/JettyTempCleaner.java b/JettyTempCleaner/src/main/java/JettyTempCleaner.java
deleted file mode 100644
index 67854ecb..00000000
--- a/JettyTempCleaner/src/main/java/JettyTempCleaner.java
+++ /dev/null
@@ -1,57 +0,0 @@
-import java.io.File;
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class JettyTempCleaner extends TimerTask {
-
- private static final long CLEAN_INTERVAL = 60000; // 1 minute
-
- private File tmpDir;
-
- public JettyTempCleaner(File tmpDir) {
- this.tmpDir = tmpDir;
- }
-
- private static boolean deleteRecursive(File f) {
- if (f.isDirectory()) {
- String[] children = f.list();
- for (String child : children) {
- if (!deleteRecursive(new File(f, child)))
- return false;
- }
- }
- return f.delete();
- }
-
- private static void clean(File tmpDir) {
- System.out.println("Trying to remove " + tmpDir);
- if (deleteRecursive(tmpDir)) {
- System.out.println("Successfully removed temporary directory");
- System.exit(0);
- }
- }
-
- private void schedule() {
- System.out.println("Scheduling cleaner for directory " + tmpDir);
- Timer t = new Timer();
- t.scheduleAtFixedRate(this, 1000, CLEAN_INTERVAL);
- }
-
- @Override
- public void run() {
- clean(tmpDir);
- }
-
- public static void main(String[] args) {
- if (args.length != 1)
- System.exit(1);
- File tmpDir = new File(args[0]);
- if (!tmpDir.exists())
- {
- System.err.println("Directory " + args[0] + " doesn't exist");
- System.exit(2);
- }
- JettyTempCleaner cleaner = new JettyTempCleaner(tmpDir);
- cleaner.schedule();
- }
-}
diff --git a/JettyTempCleaner/src/site/apt/index.apt b/JettyTempCleaner/src/site/apt/index.apt
deleted file mode 100644
index d60219dc..00000000
--- a/JettyTempCleaner/src/site/apt/index.apt
+++ /dev/null
@@ -1,12 +0,0 @@
- ---
- About
- ---
- EGIZ
- ---
- 2015
- ---
-
-Jetty Temp Cleaner
-
- This module is used to remove temporary files used by jetty after the execution of MOCCA ended
- under Microsoft Windows, as those files can't be deleted at runtime.
diff --git a/JettyTempCleaner/src/site/site.xml b/JettyTempCleaner/src/site/site.xml
deleted file mode 100644
index a1191b25..00000000
--- a/JettyTempCleaner/src/site/site.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright 2015 by Graz University of Technology, Austria
- MOCCA has been developed by the E-Government Innovation Center EGIZ, a joint
- initiative of the Federal Chancellery Austria and Graz University of Technology.
-
- Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- the European Commission - subsequent versions of the EUPL (the "Licence");
- You may not use this work except in compliance with the Licence.
- You may obtain a copy of the Licence at:
- http://www.osor.eu/eupl/
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the Licence is distributed on an "AS IS" basis,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the Licence for the specific language governing permissions and
- limitations under the Licence.
-
- This product combines work with different licenses. See the "NOTICE" text
- file for details on the various modules and licenses.
- The "NOTICE" text file is part of the distribution. Any derivative works
- that you distribute must include a readable copy of the "NOTICE" text file.
--->
-
-<project name="MOCCA">
- <publishDate position="right"/>
- <bannerLeft>
- <name>MOCCA</name>
- <src>../images/mocca2-t_s.png</src>
- <href>http://joinup.ec.europa.eu/site/mocca/</href>
- </bannerLeft>
-
- <body>
-
- <menu ref="parent"/>
-
- <menu ref="reports"/>
-
- </body>
-
-</project>