fixing bugs with non-ascii folders on windows

This commit is contained in:
benfry
2005-05-20 04:47:21 +00:00
parent c45b98aac0
commit 16ece5364c
3 changed files with 30 additions and 5 deletions
+25 -4
View File
@@ -178,7 +178,7 @@ public class Base {
static final short kUserDomain = -32763;
static public File getProcessingDataFolder() {
static public File getSettingsFolder() {
File dataFolder = null;
String pref = Preferences.get("settings.path");
@@ -296,18 +296,39 @@ public class Base {
}
static public File getProcessingDataFile(String filename) {
return new File(getProcessingDataFolder(), filename);
static public File getSettingsFile(String filename) {
return new File(getSettingsFolder(), filename);
}
static public File getBuildFolder() {
File folder = new File(getProcessingDataFolder(), "build");
String buildPath = Preferences.get("build.path");
if (buildPath != null) return new File(buildPath);
File folder = new File(getTempFolder(), "build");
if (!folder.exists()) folder.mkdirs();
return folder;
}
/**
* Get the path to the platform's temporary folder, by creating
* a temporary temporary file and getting its parent folder.
*/
static public File getTempFolder() {
try {
File ignored = File.createTempFile("ignored", null);
String tempPath = ignored.getParent();
ignored.delete();
return new File(tempPath);
} catch (Exception e) {
e.printStackTrace();
}
return null; // TODO could we *really* ever reach this?
}
/*
static public void addBuildFolderToClassPath() {
String path = getBuildFolder().getAbsolutePath();