Java URL Value Check isLocalFile(URL url)

Here you can find the source of isLocalFile(URL url)

Description

is Local File

License

LGPL

Declaration

public static boolean isLocalFile(URL url) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.File;

import java.net.URL;

public class Main {
    public static boolean isLocalFile(URL url) {
        try {/* www . j  a  v  a 2 s.c  o  m*/
            if (url.getProtocol().equals(new File(url.getFile()).toURI().toURL().getProtocol())) {
                return true;
            }
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        return false;
    }
}

Related

  1. isJBoss5Url(URL fileUrl)
  2. isLegalURL(final String url)
  3. isLocal(URL aURL)
  4. isLocalFile(URL url)
  5. isLocalFile(URL url)
  6. isLocalFile(URL url)
  7. isLocalFile(URL url)
  8. isLocalhost(URL url)
  9. isLocalURL(String s)