Index: . =================================================================== --- . (revision 696611) +++ . (working copy) @@ -22,6 +22,18 @@ import java.io.IOException; public abstract class AbstractURLHandler implements URLHandler { + + /** + * Using the slower REQUEST method for getting the basic URL infos. Use this when getting errors + * behind a problematic/special proxy or firewall chain. + */ + public static final int REQUEST_METHOD_GET = 1; + + /** + * Using the faster HEAD method for getting the basic URL infos. Works for most common networks. + */ + public static final int REQUEST_METHOD_HEAD = 2; + public boolean isReachable(URL url) { return getURLInfo(url).isReachable(); } @@ -60,10 +72,10 @@ case HttpURLConnection.HTTP_UNAUTHORIZED: /* intentional fallthrough */ case HttpURLConnection.HTTP_FORBIDDEN: - throw new IOException("Access to URL " + dest + " was refused by the server" + throw new IOException("Access to URL " + dest + " was refused by the server" + (statusMessage == null ? "" : ": " + statusMessage)); default: - throw new IOException("PUT operation to URL " + dest + " failed with status code " + throw new IOException("PUT operation to URL " + dest + " failed with status code " + statusCode + (statusMessage == null ? "" : ": " + statusMessage)); } }