- use Places.getUserDirectory instead of netbeans.user property
This commit is contained in:
parent
288f58766b
commit
763a82c464
@ -128,6 +128,7 @@ import org.openide.NotifyDescriptor;
|
|||||||
import org.openide.filesystems.FileObject;
|
import org.openide.filesystems.FileObject;
|
||||||
import org.openide.filesystems.FileUtil;
|
import org.openide.filesystems.FileUtil;
|
||||||
import org.openide.modules.InstalledFileLocator;
|
import org.openide.modules.InstalledFileLocator;
|
||||||
|
import org.openide.modules.Places;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
@ -165,7 +166,7 @@ public class BlenderTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkBlenderFolders() {
|
private static boolean checkBlenderFolders() {
|
||||||
String jmpDir = System.getProperty("netbeans.user");
|
String jmpDir = Places.getUserDirectory().getAbsolutePath();
|
||||||
FileObject fileObject = FileUtil.toFileObject(new File(jmpDir));
|
FileObject fileObject = FileUtil.toFileObject(new File(jmpDir));
|
||||||
if (fileObject != null) {
|
if (fileObject != null) {
|
||||||
FileObject configFileObject = fileObject.getFileObject(configFolderName);
|
FileObject configFileObject = fileObject.getFileObject(configFolderName);
|
||||||
@ -215,7 +216,7 @@ public class BlenderTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getConfigEnv() {
|
private static String getConfigEnv() {
|
||||||
String ret = System.getProperty("netbeans.user") + "/" + configFolderName;
|
String ret = Places.getUserDirectory().getAbsolutePath() + "/" + configFolderName;
|
||||||
ret = ret.replace("/", File.separator);
|
ret = ret.replace("/", File.separator);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -229,13 +230,13 @@ public class BlenderTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getUserScriptsEnv() {
|
private static String getUserScriptsEnv() {
|
||||||
String ret = System.getProperty("netbeans.user") + "/" + userScriptsFolderName;
|
String ret = Places.getUserDirectory().getAbsolutePath() + "/" + userScriptsFolderName;
|
||||||
ret = ret.replace("/", File.separator);
|
ret = ret.replace("/", File.separator);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getScriptPath(String scriptName, String prefix) {
|
private static String getScriptPath(String scriptName, String prefix) {
|
||||||
String ret = System.getProperty("netbeans.user") + "/" + jmeScriptsFolderName + "/" + prefix + "_" + scriptName + ".py";
|
String ret = Places.getUserDirectory().getAbsolutePath() + "/" + jmeScriptsFolderName + "/" + prefix + "_" + scriptName + ".py";
|
||||||
ret = ret.replace("/", File.separator);
|
ret = ret.replace("/", File.separator);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ import java.util.logging.Logger;
|
|||||||
import javax.swing.JPopupMenu;
|
import javax.swing.JPopupMenu;
|
||||||
import org.openide.filesystems.FileChooserBuilder;
|
import org.openide.filesystems.FileChooserBuilder;
|
||||||
import org.openide.modules.ModuleInstall;
|
import org.openide.modules.ModuleInstall;
|
||||||
|
import org.openide.modules.Places;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbPreferences;
|
import org.openide.util.NbPreferences;
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ public class Installer extends ModuleInstall {
|
|||||||
System.setProperty("netbeans.projects.dir", projectDir);
|
System.setProperty("netbeans.projects.dir", projectDir);
|
||||||
|
|
||||||
//set extraction dir for platform natives
|
//set extraction dir for platform natives
|
||||||
String jmpDir = System.getProperty("netbeans.user");
|
String jmpDir = Places.getUserDirectory().getAbsolutePath();
|
||||||
File file = new File(jmpDir);
|
File file = new File(jmpDir);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
logger.log(Level.INFO, "Create settings dir {0}", projectDir);
|
logger.log(Level.INFO, "Create settings dir {0}", projectDir);
|
||||||
|
@ -52,6 +52,8 @@ import org.netbeans.api.progress.ProgressHandle;
|
|||||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||||
import org.openide.DialogDisplayer;
|
import org.openide.DialogDisplayer;
|
||||||
import org.openide.NotifyDescriptor;
|
import org.openide.NotifyDescriptor;
|
||||||
|
import org.openide.modules.InstalledFileLocator;
|
||||||
|
import org.openide.modules.Places;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
|
|
||||||
@ -69,7 +71,7 @@ public class ZipExtensionTool {
|
|||||||
private static final Logger logger = Logger.getLogger(ZipExtensionTool.class.getName());
|
private static final Logger logger = Logger.getLogger(ZipExtensionTool.class.getName());
|
||||||
static final ConcurrentHashMap<String, Boolean> installMap = new ConcurrentHashMap<String, Boolean>();
|
static final ConcurrentHashMap<String, Boolean> installMap = new ConcurrentHashMap<String, Boolean>();
|
||||||
static final int BUFFER = 2048;
|
static final int BUFFER = 2048;
|
||||||
private final String settingsFolder = System.getProperty("netbeans.user");
|
private final String settingsFolder = Places.getUserDirectory().getAbsolutePath();
|
||||||
public String SUFFIX_WIN = "windows";
|
public String SUFFIX_WIN = "windows";
|
||||||
public String SUFFIX_LINUX = "linux";
|
public String SUFFIX_LINUX = "linux";
|
||||||
public String SUFFIX_OSX = "mac";
|
public String SUFFIX_OSX = "mac";
|
||||||
|
@ -3,6 +3,6 @@ build.xml.script.CRC32=6423eb2c
|
|||||||
build.xml.stylesheet.CRC32=79c3b980@1.31.2.7
|
build.xml.stylesheet.CRC32=79c3b980@1.31.2.7
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=356157ce
|
nbproject/build-impl.xml.data.CRC32=2f86c6ee
|
||||||
nbproject/build-impl.xml.script.CRC32=4a050ba2
|
nbproject/build-impl.xml.script.CRC32=4a050ba2
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1
|
||||||
|
@ -81,6 +81,14 @@
|
|||||||
<specification-version>7.57.2</specification-version>
|
<specification-version>7.57.2</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.modules</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>7.43.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<code-name-base>org.openide.nodes</code-name-base>
|
<code-name-base>org.openide.nodes</code-name-base>
|
||||||
<build-prerequisite/>
|
<build-prerequisite/>
|
||||||
|
@ -16,6 +16,7 @@ import org.netbeans.api.progress.ProgressHandle;
|
|||||||
import org.openide.DialogDisplayer;
|
import org.openide.DialogDisplayer;
|
||||||
import org.openide.NotifyDescriptor;
|
import org.openide.NotifyDescriptor;
|
||||||
import org.openide.NotifyDescriptor.Confirmation;
|
import org.openide.NotifyDescriptor.Confirmation;
|
||||||
|
import org.openide.modules.Places;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
|
|
||||||
@ -26,9 +27,9 @@ import org.openide.util.Utilities;
|
|||||||
public class OgreXMLConvert {
|
public class OgreXMLConvert {
|
||||||
|
|
||||||
static final int BUFFER = 2048;
|
static final int BUFFER = 2048;
|
||||||
public static String osx_path = System.getProperty("netbeans.user") + "/ogretools/";
|
public static String osx_path = Places.getUserDirectory().getAbsolutePath() + "/ogretools/";
|
||||||
public static String windows_path = System.getProperty("netbeans.user") + "\\ogretools\\";
|
public static String windows_path = Places.getUserDirectory().getAbsolutePath() + "\\ogretools\\";
|
||||||
public static String linux_path = System.getProperty("netbeans.user") + "/.ogretools/";
|
public static String linux_path = Places.getUserDirectory().getAbsolutePath() + "/.ogretools/";
|
||||||
|
|
||||||
public boolean doConvert(OgreXMLConvertOptions options, ProgressHandle handle) {
|
public boolean doConvert(OgreXMLConvertOptions options, ProgressHandle handle) {
|
||||||
if (!checkTools()) {
|
if (!checkTools()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user