Java URL Value Check isLocalFile(URL url)

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

Description

Adapted from http://www.java2s.com/Code/Java/Network-Protocol/IsURLalocalfile.htm

License

Apache License

Parameter

Parameter Description
url a parameter

Declaration

private static boolean isLocalFile(URL url) 

Method Source Code

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

import java.net.URL;

public class Main {
    /**/*from   ww w .jav  a 2  s. co  m*/
     * Adapted from http://www.java2s.com/Code/Java/Network-Protocol/IsURLalocalfile.htm
     * @param url
     * @return
     */
    private static boolean isLocalFile(URL url) {
        return ((url.getProtocol().equals("file")) && (url.getHost() == null || url.getHost().equals("")));
    }
}

Related

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