通过对URL判断,检测引用的文件是否存在
HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection)new URL(“文件路径”).openConnection(); con.setRequestMethod( "HEAD");