aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/installer/EclipseFinder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/installer/EclipseFinder.java')
-rw-r--r--src/lombok/installer/EclipseFinder.java15
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 ) {}