can I check if a file exists at a URL?

http, java

Solution

It's quite similar in Java. You just need to evaluate the HTTP Response code:

final URL url = new URL("http://some.where/file.html");
url.openConnection().getResponseCode();

A more complete example can be found here.

Problem

can I check if a file exists at a URL? This link is very good for C#, what about java. I serach but i did not find good solution.

Original source

Related problems