public static String extractFileNameFromUrl(String url) {
		HashMap<Integer, String> map = new HashMap<Integer, String>();
		map.put(4, "html,aspx");
		map.put(3, "jsp,php");
		StringBuilder fileName = null;
		StringBuilder builder = new StringBuilder(url);
		boolean found = false;
		for (int i = builder.lastIndexOf("."); i >= 0; i--) {
			char c = builder.charAt(i);
			if (c == '.' && (i + 1) != builder.length()) {
				int changedIndex = 0;
				for (Integer key : map.keySet()) {
					changedIndex = key + (i + 1);
					if (changedIndex <= builder.length()) {
						String dummy = builder.substring(i + 1, changedIndex);
						String extAry[] = map.get(key).split(",");
						for (String temp : extAry) {
							if (temp.equalsIgnoreCase(dummy)) {
								int y = i;
								String str = builder.substring(0, y);
								int lstInd = str.lastIndexOf("/");
								fileName = new StringBuilder(str.substring(
										lstInd + 1, str.length()));
								fileName.append(".");
								fileName.append(dummy);
								found = true;
								break;
							}
						}
					}
					if (found) {
						i = -1;
						break;
					}
				}
			}
		}
		if (!found) {
			fileName = new StringBuilder(String.valueOf(new Date().getTime()));
		}
		return fileName.toString();
	}