JAL-4477 Change to Files.createDirectories(). Adding sun.jnu.encoding=UTF-8 to instal...
authorBen Soares <b.soares@dundee.ac.uk>
Tue, 29 Oct 2024 18:41:19 +0000 (18:41 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Tue, 29 Oct 2024 18:41:19 +0000 (18:41 +0000)
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java
getdown/src/getdown/core/src/main/java/jalview/util/FileUtils.java
gradle.properties
j11lib/getdown-core.jar
j8lib/getdown-core.jar
src/jalview/util/FileUtils.java

index c145270..5d149ac 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index a2d604e..28781a0 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index 1676032..fd2b05f 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index 047269d..5378f62 100644 (file)
@@ -1099,6 +1099,7 @@ public class Application
         addSystemPropertyIfNotNull(args, "installer.logfile");
         addSystemPropertyIfNotNull(args, "installer.logfile_append");
         addSystemPropertyIfNotNull(args, "installer.extrainfo");
+        addSystemPropertyIfNotNull(args, "sun.jnu.encoding");
         
         // backward compatibility (old getdown-launcher.jar)
         args.add("-Dgetdownappdir=" + getAppDir());
index bdaba7a..7c4f669 100644 (file)
@@ -411,7 +411,17 @@ public final class EnvConfig {
         if (setUserAppDirPath.startsWith("~" + FS)) {
           setUserAppDirPath = home + setUserAppDirPath.substring(1);
         }
-        appDataPath = setUserAppDirPath.replaceAll("%u", System.getProperty("user.name")).replaceAll("%h", home);
+        String username = System.getProperty("user.name");
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < username.length(); i++) {
+          String code = Integer.toHexString(Character.codePointAt(username, i));
+          if (i > 0) {
+            sb.append("-");
+          }
+          sb.append(code);
+        }
+        String asciiname = sb.toString();
+        appDataPath = setUserAppDirPath.replaceAll("%u", username).replaceAll("%h", home).replaceAll("%U", asciiname);
         addHome = false;
       }
       
index 2681de6..ce74673 100644 (file)
@@ -390,7 +390,7 @@ public class FileUtils
   {
     try
     {
-      Files.createDirectory(getCanonicalPath(file));
+      Files.createDirectories(getCanonicalPath(file));
       return file.exists();
     } catch (IOException e)
     {
index 823264c..7320a42 100644 (file)
@@ -130,12 +130,12 @@ flexmark_css = utils/doc/github.css
 channel_properties_dir = utils/channels
 channel_props = channel.props
 
-install4j_home_dir = ~/buildtools/install4j10
+install4j_home_dir = ~/buildtools/install4j11
 install4j_copyright_message = ...
 install4j_bundle_id = org.jalview.jalview-desktop
 install4j_utils_dir = utils/install4j
 install4j_images_dir = utils/install4j
-install4j_template = install4j10_template.install4j
+install4j_template = install4j11_template.install4j
 install4j_info_plist_file_associations = file_associations_auto-Info_plist.xml
 install4j_installer_file_associations = file_associations_auto-install4j10.xml
 #install4j_DMG_uninstaller_app_files = uninstall_old_jalview_files.xml
index c145270..5d149ac 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index c145270..5d149ac 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ
index 2681de6..ce74673 100644 (file)
@@ -390,7 +390,7 @@ public class FileUtils
   {
     try
     {
-      Files.createDirectory(getCanonicalPath(file));
+      Files.createDirectories(getCanonicalPath(file));
       return file.exists();
     } catch (IOException e)
     {