From 2a776580f2e56eb7f7abdb7b92cabc8e92e65578 Mon Sep 17 00:00:00 2001 From: erik Date: Sat, 17 Feb 2007 09:19:38 +0000 Subject: [PATCH] now deleting the link structure at startup and rebuilding it again completely. --- .classpath | 47 ++++++++++--------- .../org/wamblee/mythtv/LinkStructure.java | 12 ++++- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/.classpath b/.classpath index 7b60329b..e18b6562 100644 --- a/.classpath +++ b/.classpath @@ -1,24 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java b/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java index cbf24451..7effde65 100644 --- a/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java +++ b/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) -- 2.31.1