Java URI Value Check isLocalFile(URI uri)

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

Description

Tests to see if a URI represents a local file.

License

Open Source License

Parameter

Parameter Description
uri The URI. May be <code>null</code>.

Return

true if the URI represents a local file, otherwise false.

Declaration

public static boolean isLocalFile(URI uri) 

Method Source Code

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

import java.net.URI;

public class Main {
    public static final String FILE_URI_SCHEME = "file";

    /**/*from  w ww.  j  a v  a 2 s . co  m*/
     * Tests to see if a URI represents a local file.
     * @param uri The URI.  May be <code>null</code>.
     * @return <code>true</code> if the URI represents a local file, otherwise <code>false</code>.
     */
    public static boolean isLocalFile(URI uri) {
        if (uri == null) {
            return false;
        }
        String scheme = uri.getScheme();
        return scheme != null && FILE_URI_SCHEME.equals(scheme.toLowerCase());
    }
}

Related

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