code: public static String getFilename(final URL url) throws UnsupportedEncodingException
  	{
  		if (isJar(url) || isEar(url))
  		{
  			String fileName = URLDecoder.decode(url.getFile(), "UTF-8");
  			fileName = fileName.substring(5, fileName.indexOf("!"));
  			return fileName;
  		}
  		return URLDecoder.decode(url.getFile(), "UTF-8");
  	}
docs: Gets the filename from the given url object.
  
  @param url
  the url
  @return the filename
  @throws UnsupportedEncodingException
  the unsupported encoding exception