X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Futil%2FForesterUtil.java;h=c98edc070058773ce73ab73842001dc0b3178d2d;hb=7713a9bc5abcc18bcfeb3b8e4d172edef36b0992;hp=a8c81b0dd23ae214f2280b324a659ae3f3f544f2;hpb=aec065f948a075773794133f102ea19eb1d59f64;p=jalview.git diff --git a/forester/java/src/org/forester/util/ForesterUtil.java b/forester/java/src/org/forester/util/ForesterUtil.java index a8c81b0..c98edc0 100644 --- a/forester/java/src/org/forester/util/ForesterUtil.java +++ b/forester/java/src/org/forester/util/ForesterUtil.java @@ -62,6 +62,7 @@ import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.forester.archaeopteryx.Constants; import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Distribution; import org.forester.phylogeny.data.Sequence; @@ -683,8 +684,24 @@ public final class ForesterUtil { return isReadableFile( new File( s ) ); } - public static boolean isWindowns() { - return ForesterUtil.OS_NAME.toLowerCase().indexOf( "win" ) > -1; + public final static boolean isWindows() { + try { + return OS_NAME.toLowerCase().indexOf( "win" ) > -1; + } + catch ( final Exception e ) { + ForesterUtil.printWarningMessage( Constants.PRG_NAME, "minor error: " + e ); + return false; + } + } + + public final static boolean isMac() { + try { + return OS_NAME.toLowerCase().startsWith( "mac" ); + } + catch ( final Exception e ) { + ForesterUtil.printWarningMessage( Constants.PRG_NAME, "minor error: " + e ); + return false; + } } final public static String isWritableFile( final File f ) {