Java Is Relative Path isRelative(String path)

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

Description

A simple way to check if the path is relative o absolute

License

Open Source License

Parameter

Parameter Description
path a parameter

Declaration

public static boolean isRelative(String path) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**//from   w  ww .j a  v a 2s.  c o  m
     * A simple way to check if the path is relative o absolute
     * @param path
     * @return 
     */
    public static boolean isRelative(String path) {
        if (path.indexOf(File.separator) >= 0) {
            return false;
        }
        return true;
    }
}

Related

  1. isRelative(File target_)
  2. isRelative(final String path)
  3. isRelativePath(final String filePath)
  4. isRelativePath(String candidatePath)
  5. isRelativePath(String fileName)
  6. isRelativePath(String path)