Here you can find the source of isFileSpecified(URL url)
Parameter | Description |
---|---|
url | the url to test |
public static boolean isFileSpecified(URL url)
//package com.java2s; //License from project: LGPL import java.net.URL; public class Main { /**/*w w w . j a va2 s . co m*/ * Determines whether a file is specified in the path part of the url. * This is assumed to be the case if the string after the last slash * contains a dot (aaaaa/bbbb/cccc.dddd). * @param url the url to test * @return boolean value indicating whether a file is specified */ public static boolean isFileSpecified(URL url) { boolean specified = false; String path = url.getPath(); int posLastSlash = path.lastIndexOf('/'); int posLastDot = path.lastIndexOf('.'); specified = posLastDot > posLastSlash; return specified; } }