Search in sources :

Example 1 with HttpRequestException

use of aQute.bnd.http.HttpRequestException in project bnd by bndtools.

the class MavenRemoteRepository method delete.

public boolean delete(String path) throws Exception {
    URL url = new URL(base + path);
    TaggedData go = client.build().put().delete().get(TaggedData.class).go(url);
    if (go == null)
        return false;
    if (go.getResponseCode() == HttpURLConnection.HTTP_OK || go.getResponseCode() == HttpURLConnection.HTTP_NO_CONTENT) {
        client.build().delete().async(new URL(base + path + ".sha1"));
        client.build().delete().async(new URL(base + path + ".md5"));
        return true;
    }
    throw new HttpRequestException(go);
}
Also used : HttpRequestException(aQute.bnd.http.HttpRequestException) TaggedData(aQute.bnd.service.url.TaggedData) URL(java.net.URL)

Aggregations

HttpRequestException (aQute.bnd.http.HttpRequestException)1 TaggedData (aQute.bnd.service.url.TaggedData)1 URL (java.net.URL)1