Java URI Value Check isLocal(final URI uri)

Here you can find the source of isLocal(final URI uri)

Description

Check if the data pointed by given URL is inside or outside current fileSystem.

License

Open Source License

Parameter

Parameter Description
uri The address of the file to test.

Return

true if the URL describe a local file, false otherwise.

Declaration

public static boolean isLocal(final URI uri) 

Method Source Code

//package com.java2s;
/*/*from ww  w .  ja  v a  2 s  .  co  m*/
 *    Geotoolkit - An Open Source Java GIS Toolkit
 *    http://www.geotoolkit.org
 *
 *    (C) 2013, Geomatys
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */

import java.net.URI;

public class Main {
    /**
     * Check if the data pointed by given URL is inside or outside current fileSystem.
     * @param uri The address of the file to test.
     * @return true if the URL describe a local file, false otherwise.
     */
    public static boolean isLocal(final URI uri) {
        return "file".equalsIgnoreCase(uri.getScheme());
    }
}

Related

  1. isFtp(URI uri)
  2. isHostDnsName(URI uri)
  3. isIRODSURIScheme(final URI irodsURI)
  4. isJar(final URI uri)
  5. isJarFile(final URI uri)
  6. isLocal(final URI uri)
  7. isLocalFile(URI uri)
  8. isLocalFile(URI uri)
  9. isLocalUri(String uriString)