Java Path Is Absolute isAbsolutePath(String path)

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

Description

Checks wether the specified path expression is an absolute path.

License

BSD License

Parameter

Parameter Description
path the path expression.

Return

true if specified path expression is an absolute path, otherwise false.

Declaration

public static boolean isAbsolutePath(String path) 

Method Source Code

//package com.java2s;
/*/*w w w  .j  a v  a 2 s . co  m*/
 * Copyright (c) 2012. betterFORM Project - http://www.betterform.de
 * Licensed under the terms of BSD License
 */

public class Main {
    /**
     * Start of an instance() function expression.
     */
    public static final String INSTANCE_FUNCTION = "instance(";

    /**
     * Checks wether the specified path expression is an absolute path.
     *
     * @param path the path expression.
     * @return <code>true</code> if specified path expression is an absolute
     * path, otherwise <code>false</code>.
     */
    public static boolean isAbsolutePath(String path) {
        return path != null && (path.startsWith("/") || path.startsWith(INSTANCE_FUNCTION));
    }
}

Related

  1. isAbsolutePath(String path)
  2. isAbsolutePath(String path)
  3. isAbsolutePath(String path)
  4. isAbsolutePath(String path)
  5. isAbsolutePath(String path)
  6. isAbsolutePath(String path)
  7. isAbsolutePath(String path)
  8. isAbsolutePath(String path)
  9. IsAbsolutePath(String strPath)