diff options
author | Roel Spilker <r.spilker@gmail.com> | 2009-07-17 15:26:09 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2009-07-17 15:26:09 +0200 |
commit | b1d8d1dfc4856ccd7e89f75c47d308dba0c022c5 (patch) | |
tree | 302b9e1fd0ee7e395b8a50811a80ba3dfedd4971 /src/lombok | |
parent | d87a5204cfb17de787e787c0b6dad246b42a2b58 (diff) | |
download | lombok-b1d8d1dfc4856ccd7e89f75c47d308dba0c022c5.tar.gz lombok-b1d8d1dfc4856ccd7e89f75c47d308dba0c022c5.tar.bz2 lombok-b1d8d1dfc4856ccd7e89f75c47d308dba0c022c5.zip |
Made the detection of drives more robust on Windows
Diffstat (limited to 'src/lombok')
-rw-r--r-- | src/lombok/installer/EclipseFinder.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lombok/installer/EclipseFinder.java b/src/lombok/installer/EclipseFinder.java index 1abebeec..ba3c7e14 100644 --- a/src/lombok/installer/EclipseFinder.java +++ b/src/lombok/installer/EclipseFinder.java @@ -71,7 +71,7 @@ class EclipseFinder { * @return A List of drive letters, such as ["A", "C", "D", "X"]. */ static List<String> getDrivesOnWindows() throws IOException { - ProcessBuilder builder = new ProcessBuilder("c:\\windows\\system32\\fsutil.exe", "fsinfo", "drives"); + ProcessBuilder builder = new ProcessBuilder("fsutil.exe", "fsinfo", "drives"); builder.redirectErrorStream(true); Process process = builder.start(); InputStream in = process.getInputStream(); @@ -81,9 +81,15 @@ class EclipseFinder { String line; while ( (line = br.readLine()) != null ) { - if ( line.startsWith("Drives: ") ) { - line = line.substring(8); - for ( String driveLetter : line.split("\\:\\\\\\s*") ) drives.add(driveLetter.trim()); + if (line.startsWith("Drives:")) { + line = line.substring(7); + } + line = line.trim(); + if (line.isEmpty()) { + continue; + } + for ( String driveLetter : line.split("\\:\\\\\\s*") ) { + drives.add(driveLetter.trim()); } } @@ -135,7 +141,6 @@ class EclipseFinder { static List<String> findEclipseOnWindows() { List<String> eclipses = new ArrayList<String>(); List<String> driveLetters = asList("C"); - try { driveLetters = getDrivesOnWindows(); } catch ( IOException ignore ) {} |