import java.net.URI;
public class Main {
public static void main(String... args) throws Exception {
String url = "http://www.w3cschool.cn/Tutorials/Java/Algorithms_How_to/index.htm";
URI u = new URI(url);
for (String ext : new String[] { ".png", ".pdf", ".jpg", ".html","htm" }) {
if (u.getPath().endsWith(ext)) {
System.out.println("Yeap");
break;
}
}
}
}