Java Path Is Absolute isAbsolutePath(String path)

Here you can find the source of isAbsolutePath(String path)

Description

is Absolute Path

License

Open Source License

Declaration

public static boolean isAbsolutePath(String path) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    public static boolean isAbsolutePath(String path) {
        boolean isWindows = getPlatform().startsWith("win");
        if (isWindows)
            return path.length() > 1 && path.charAt(1) == ':';
        return path.startsWith("/");
    }//ww  w . j  a  v  a2 s  .  c o  m

    public static String getPlatform() {
        boolean is64bit = System.getProperty("os.arch", "").indexOf("64") >= 0;
        String osName = System.getProperty("os.name", "<unknown>");
        if (osName.equals("Linux"))
            return "linux" + (is64bit ? "64" : "32");
        if (osName.equals("Mac OS X"))
            return "macosx";
        if (osName.startsWith("Windows"))
            return "win" + (is64bit ? "64" : "32");
        //System.err.println("Unknown platform: " + osName);
        return osName.toLowerCase();
    }
}

Related

  1. isAbsolute(String aPath)
  2. isAbsolute(String path)
  3. isAbsolute(String path)
  4. isAbsolute(String path)
  5. isAbsolutePath(String filename)
  6. isAbsolutePath(String path)
  7. isAbsolutePath(String path)
  8. isAbsolutePath(String path)
  9. isAbsolutePath(String path)