1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Fixed bug with paths with spaces

This commit is contained in:
Federico Fissore 2015-02-02 15:30:34 +01:00
parent 7f6cf5d7ef
commit ce911788eb

View File

@ -7,6 +7,7 @@ import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -167,7 +168,11 @@ public class BaseNoGui {
File path = new File(System.getProperty("user.dir"));
if (OSUtils.isMacOS()) {
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
try {
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
return new File(path, name);