Here you can find the source of isAbsolutePath(String path)
Parameter | Description |
---|---|
path | The path in question. |
public static boolean isAbsolutePath(String path)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Arapiki Solutions Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w ww .jav a 2 s .com*/ * "Peter Smith <psmith@arapiki.com>" - initial API and * implementation and/or initial documentation *******************************************************************************/ public class Main { /** * Determine whether a file system path is absolute or relative. * * @param path The path in question. * @return True if absolute, else false. */ public static boolean isAbsolutePath(String path) { return ((path != null) && (!path.isEmpty()) && ((path.charAt(0) == '/') || (path.charAt(0) == '\\'))); } }