Here you can find the source of isFile(final URI uri)
Parameter | Description |
---|---|
uri | a parameter |
public static boolean isFile(final URI uri)
//package com.java2s; /*//from w w w . j a v a 2 s .c o m * Copyright (c) 2014 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial concept and initial implementation */ import java.net.URI; import java.net.URL; public class Main { /** * Is the URI representing a file?? * * @param uri * @return True if the URI is representing a file */ public static boolean isFile(final URI uri) { if ((uri != null) && (uri.getScheme() != null)) { return uri.getScheme().equalsIgnoreCase("file"); } return false; } /** * Is the URL representing a file?? * * @param url * @return True if the URL is representing a file */ public static boolean isFile(final URL url) { if ((url != null) && (url.getProtocol() != null)) { return url.getProtocol().equalsIgnoreCase("file"); } return false; } }