@Override public Volume inspectVolume(final String volumeName) throws DockerException, InterruptedException { final WebTarget resource = resource().path("volumes").path(volumeName); try { return request(GET, Volume.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new VolumeNotFoundException(volumeName, e); default: throw e; } } }
@Override public void removeVolume(final String volumeName) throws DockerException, InterruptedException { final WebTarget resource = resource().path("volumes").path(volumeName); try { request(DELETE, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new VolumeNotFoundException(volumeName, e); case 409: throw new ConflictException("Volume is in use and cannot be removed", e); default: throw e; } } }
@Override public Volume inspectVolume(final String volumeName) throws DockerException, InterruptedException { final WebTarget resource = resource().path("volumes").path(volumeName); try { return request(GET, Volume.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new VolumeNotFoundException(volumeName, e); default: throw e; } } }
@Override public void removeVolume(final String volumeName) throws DockerException, InterruptedException { final WebTarget resource = resource().path("volumes").path(volumeName); try { request(DELETE, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new VolumeNotFoundException(volumeName, e); case 409: throw new ConflictException("Volume is in use and cannot be removed", e); default: throw e; } } }