[jsword-svn] r2049 - trunk/jsword/src/main/java/org/crosswire/common/util

dmsmith at crosswire.org dmsmith at crosswire.org
Thu Dec 9 06:52:58 MST 2010


Author: dmsmith
Date: 2010-12-09 06:52:58 -0700 (Thu, 09 Dec 2010)
New Revision: 2049

Modified:
   trunk/jsword/src/main/java/org/crosswire/common/util/OSType.java
Log:
JS-141: Fixed a regression in OSType. It failed to work on Mac and Windows.

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/OSType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/OSType.java	2010-12-08 20:25:43 UTC (rev 2048)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/OSType.java	2010-12-09 13:52:58 UTC (rev 2049)
@@ -33,30 +33,36 @@
  */
 public enum OSType {
     MAC  ("Mac") {
+        @Override
         public URI getUserArea() {
             return NetUtil.lengthenURI(getUserHome(), MAC_USER_DATA_AREA);
         }
 
+        @Override
         public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) {
             return NetUtil.lengthenURI(getUserArea(), visibleFolderName);
         }
     },
 
     WIN32  ("Win") {
+        @Override
         public URI getUserArea() {
             return NetUtil.lengthenURI(getUserHome(), WIN32_USER_DATA_AREA);
         }
 
+        @Override
         public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) {
             return NetUtil.lengthenURI(getUserArea(), visibleFolderName);
         }
     },
 
     DEFAULT ("*nix") {
+        @Override
         public URI getUserArea() {
             return getUserHome();
         }
 
+        @Override
         public URI getUserAreaFolder(String hiddenFolderName, String visibleFolderName) {
             return NetUtil.lengthenURI(getUserArea(), hiddenFolderName);
         }
@@ -107,7 +113,7 @@
      */
     public static OSType fromString(String name) {
         for (OSType v : values()) {
-            if (v.name.equalsIgnoreCase(name)) {
+            if (name.startsWith(v.name)) {
                 return v;
             }
         }
@@ -120,6 +126,7 @@
      * 
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
         return name;
     }




More information about the jsword-svn mailing list