Here you can find the source of isFileUri(String uri)
public static boolean isFileUri(String uri) throws URISyntaxException
//package com.java2s; //License from project: Apache License import java.net.URI; import java.net.URISyntaxException; public class Main { static String FILE = "file"; public static boolean isFileUri(String uri) throws URISyntaxException { String scheme = (new URI(uri)).getScheme(); if (scheme != null) return scheme.toLowerCase().equals(FILE); return false; }//ww w . j a va 2s . c o m public static String getScheme(String uri) throws URISyntaxException { String scheme = (new URI(uri)).getScheme(); if (scheme != null) return scheme.toLowerCase(); return null; } }