Here you can find the source of isFileURI(URI uri)
Parameter | Description |
---|---|
uri | The URI to check |
true
if the URI is a local file system location, and false
otherwise
public static boolean isFileURI(URI uri)
//package com.java2s; /******************************************************************************* * Copyright (c) 2008, 2009 IBM Corporation and others. * 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:/*w w w. j a v a2 s .c om*/ * IBM Corporation - initial API and implementation *******************************************************************************/ import java.net.*; public class Main { private static final String SCHEME_FILE = "file"; /** * Returns whether the given URI refers to a local file system URI. * @param uri The URI to check * @return <code>true</code> if the URI is a local file system location, and <code>false</code> otherwise */ public static boolean isFileURI(URI uri) { return SCHEME_FILE.equalsIgnoreCase(uri.getScheme()); } }