Java URI Value Check isFileURI(URI uri)

Here you can find the source of isFileURI(URI uri)

Description

Returns whether the given URI refers to a local file system URI.

License

Open Source License

Parameter

Parameter Description
uri The URI to check

Return

true if the URI is a local file system location, and false otherwise

Declaration

public static boolean isFileURI(URI uri) 

Method Source Code

//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());
    }
}

Related

  1. isFile(final URI uri)
  2. isFile(URI uri)
  3. isFile(URI uri)
  4. isFileSystemAvailable(File file, URI topLevelResource)
  5. isFileUri(String uri)
  6. isFileURI(URI uri)
  7. isFileUri(URI uri)
  8. isFtp(URI uri)
  9. isHostDnsName(URI uri)