From: erik Date: Sat, 17 Feb 2007 09:19:38 +0000 (+0000) Subject: now deleting the link structure at startup and rebuilding it again X-Git-Tag: wamblee-utils-0.2@603~273 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=fdc49800ea8a9b25fcef7d2f84eecd4354c7eba6;p=utils now deleting the link structure at startup and rebuilding it again completely. --- diff --git a/trunk/.classpath b/trunk/.classpath index 7b60329b..e18b6562 100644 --- a/trunk/.classpath +++ b/trunk/.classpath @@ -1,24 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java b/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java index cbf24451..7effde65 100644 --- a/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java +++ b/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java @@ -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(); } + + private void deleteDir(File aFile) { + for (File file: aFile.listFiles()) { + if ( file.isDirectory()) { + deleteDir(file); + } + LOG.info("File deleted " + file + ": " + file.delete()); + } + } /* * (non-Javadoc)