now deleting the link structure at startup and rebuilding it again
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Feb 2007 09:19:38 +0000 (09:19 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 17 Feb 2007 09:19:38 +0000 (09:19 +0000)
completely.

.classpath
mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java

index 7b60329bd00788fba64ad491c085f3ce320e36da..e18b656283c0017d3a7d1ab354ca9dcd5c07b8f1 100644 (file)
@@ -1,24 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="support/src/main/java"/>
-       <classpathentry kind="src" path="support/src/test/java"/>
-       <classpathentry excluding="**" output="support/src/main/resources" kind="src" path="support/src/main/resources"/>
-       <classpathentry excluding="**" output="support/src/test/resources" kind="src" path="support/src/test/resources"/>
-       <classpathentry kind="src" path="socketproxy/src/main/java"/>
-       <classpathentry kind="src" path="socketproxy/src/test/java"/>
-       <classpathentry excluding="**" output="socketproxy/src/test/resources" kind="src" path="socketproxy/src/test/resources"/>
-       <classpathentry kind="src" path="crawler/basic/src/main/java"/>
-       <classpathentry kind="src" path="crawler/basic/src/test/java"/>
-       <classpathentry excluding="**" output="crawler/basic/src/test/resources" kind="src" path="crawler/basic/src/test/resources"/>
-       <classpathentry kind="src" path="crawler/kiss/src/main/java"/>
-       <classpathentry kind="src" path="crawler/kiss/src/test/java"/>
-       <classpathentry excluding="**" output="crawler/kiss/src/main/resources" kind="src" path="crawler/kiss/src/main/resources"/>
-       <classpathentry excluding="**" output="crawler/kiss/src/test/resources" kind="src" path="crawler/kiss/src/test/resources"/>
-       <classpathentry kind="src" path="crawler/kissweb/src/main/java"/>
-       <classpathentry kind="src" path="crawler/kissweb/src/test/java"/>
-       <classpathentry excluding="**" output="crawler/kissweb/src/main/resources" kind="src" path="crawler/kissweb/src/main/resources"/>
-       <classpathentry excluding="**" output="crawler/kissweb/src/test/resources" kind="src" path="crawler/kissweb/src/test/resources"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-       <classpathentry kind="output" path="crawler/basic/build/bin"/>
+       <classpathentry path="support/src/main/java" kind="src"/>
+       <classpathentry path="support/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="support/src/main/resources" output="support/src/main/resources" kind="src"/>
+       <classpathentry excluding="**" path="support/src/test/resources" output="support/src/test/resources" kind="src"/>
+       <classpathentry path="socketproxy/src/main/java" kind="src"/>
+       <classpathentry path="socketproxy/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="socketproxy/src/test/resources" output="socketproxy/src/test/resources" kind="src"/>
+       <classpathentry path="crawler/basic/src/main/java" kind="src"/>
+       <classpathentry path="crawler/basic/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="crawler/basic/src/test/resources" output="crawler/basic/src/test/resources" kind="src"/>
+       <classpathentry path="crawler/kiss/src/main/java" kind="src"/>
+       <classpathentry path="crawler/kiss/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="crawler/kiss/src/main/resources" output="crawler/kiss/src/main/resources" kind="src"/>
+       <classpathentry excluding="**" path="crawler/kiss/src/test/resources" output="crawler/kiss/src/test/resources" kind="src"/>
+       <classpathentry path="crawler/kissweb/src/main/java" kind="src"/>
+       <classpathentry path="crawler/kissweb/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="crawler/kissweb/src/main/resources" output="crawler/kissweb/src/main/resources" kind="src"/>
+       <classpathentry excluding="**" path="crawler/kissweb/src/test/resources" output="crawler/kissweb/src/test/resources" kind="src"/>
+       <classpathentry path="gps/src/main/java" kind="src"/>
+       <classpathentry path="gps/src/test/java" kind="src"/>
+       <classpathentry excluding="**" path="gps/src/test/resources" output="gps/src/test/resources" kind="src"/>
+       <classpathentry path="mythtv/src/main/java" kind="src"/>
+       <classpathentry excluding="**" path="mythtv/src/main/resources" output="mythtv/src/main/resources" kind="src"/>
+       <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/>
+       <classpathentry path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" kind="con"/>
+       <classpathentry path="crawler/basic/build/bin" kind="output"/>
 </classpath>
index cbf24451b3621766aeda1a182ae8fac63dbd1cb5..7effde65b830ce580600e97351d940c7b1dcb767 100644 (file)
@@ -34,7 +34,7 @@ public class LinkStructure implements Listener {
 
     private static final Log LOG = LogFactory.getLog(LinkStructure.class);
 
-    private String _monitorDir = "/mnt/vcr";
+    private String _monitorDir;
 
     private File _linkDir;
 
@@ -47,11 +47,21 @@ public class LinkStructure implements Listener {
     public LinkStructure(String aMonitorDir, File aLinkDir,
             RecordingDatabase aDatabase) {
         _monitorDir = aMonitorDir + "/";
+        deleteDir(aLinkDir);
         _linkDir = aLinkDir;
         _database = aDatabase;
         _format = new SimpleDateFormat("yyyy-MM-dd-HH:mm");
         _recordings = new HashMap<File,Recording>();
     }
+    
+    private void deleteDir(File aFile) { 
+        for (File file: aFile.listFiles()) { 
+            if ( file.isDirectory()) { 
+                deleteDir(file);   
+            }
+            LOG.info("File deleted " + file + ": " + file.delete()); 
+        }
+    }
 
     /*
      * (non-Javadoc)