From a07489f92a88e81107965d94f06ff83a1511dd00 Mon Sep 17 00:00:00 2001 From: ribeaudc <ribeaudc> Date: Tue, 12 Jun 2007 06:35:21 +0000 Subject: [PATCH] change: - remove redundant functionality between OSUtilities and SystemUtils (commons lang) SVN: 456 --- .../cisd/common/utilities/OSUtilities.java | 43 ++++--------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/OSUtilities.java b/common/source/java/ch/systemsx/cisd/common/utilities/OSUtilities.java index 0643bd71e16..004915dc28c 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/OSUtilities.java +++ b/common/source/java/ch/systemsx/cisd/common/utilities/OSUtilities.java @@ -25,46 +25,19 @@ import java.util.regex.Pattern; /** * Some useful methods related to the operating system. * <p> - * Does <em>not</em> depend on any library jar files. + * Does <em>not</em> depend on any library jar files. But before using or extending this class and if you do not mind + * using <a href="http://jakarta.apache.org/commons/lang/">commons lang</a>, then have a look on + * <code>SystemUtils</code>. + * </p> * * @author Bernd Rinn */ public class OSUtilities { - private static final File WORKING_DIRECTORY = new File(System.getProperty("user.dir")); - - private static final File HOME_DIRECTORY = new File(System.getProperty("user.home")); - - private static final File TEMPORARY_DIRECTORY = new File(System.getProperty("java.io.tmpdir")); - /** Platform specific line separator. */ public static final String LINE_SEPARATOR = System.getProperty("line.separator"); - /** - * @return The current working directory of this Java VM. - */ - public static File getWorkingDirectory() - { - return WORKING_DIRECTORY; - } - - /** - * @return The home directory of the user that runs this program. - */ - public static File getHomeDirectory() - { - return HOME_DIRECTORY; - } - - /** - * @return The temporary directory of this Java VM. - */ - public static File getTemporaryDirectory() - { - return TEMPORARY_DIRECTORY; - } - /** * @return <code>true</code> if the operating system is UNIX like. */ @@ -80,10 +53,10 @@ public class OSUtilities { return (File.separatorChar == '\\'); } - - /** - * @return <code>true</code> if the the operating system is a flavor of MacOS. - */ + + /** + * @return <code>true</code> if the the operating system is a flavor of MacOS. + */ public static boolean isMacOS() { return System.getProperty("java.vendor").startsWith("Apple"); -- GitLab