From 6afeb535cdb35460bfe2d5fbb0f261ad7ae3999d Mon Sep 17 00:00:00 2001 From: det Date: Sat, 7 Jun 2008 12:51:07 +0000 Subject: [PATCH] another bugfix for the windows drive check git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4896 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/tools/diskUsage.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/tools/diskUsage.java b/source/de/anomic/tools/diskUsage.java index b572db4be..6ce95abaa 100644 --- a/source/de/anomic/tools/diskUsage.java +++ b/source/de/anomic/tools/diskUsage.java @@ -364,14 +364,26 @@ nextLine: File file = new File("DATA"); String path = null; - try { path = file.getCanonicalPath().toString(); } catch (IOException e) { return; } + try { path = file.getCanonicalPath().toString(); } catch (IOException e) { + errorMessage = "Cant get DATA directory"; + usable = false; + return; + } if (path.length() < 6) return; int index = -1; - try { index = usedVolumes.indexOf(path.substring(0, 1)); } catch (IndexOutOfBoundsException e) { return; } + try { index = allVolumes.indexOf(path.substring(0, 1)); } catch (IndexOutOfBoundsException e) { + errorMessage = "Start volume not found in all volumes"; + usable = false; + return; + } if (index > -1) usedVolumes.set(index, true); + else { + errorMessage = "No start volume found"; + usable = false; + } } public void dfWindows () {