From fdc49800ea8a9b25fcef7d2f84eecd4354c7eba6 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. --- trunk/.classpath | 47 ++++++++++--------- .../org/wamblee/mythtv/LinkStructure.java | 12 ++++- 2 files changed, 37 insertions(+), 22 deletions(-) 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) -- 2.31.1