@Test public void testDeleteElement() throws Exception { long beforeCreated = System.currentTimeMillis(); Thread.sleep(10); String originalString = "The rain in Spain falls mainly on the plain"; ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(originalString.getBytes()); int status = HttpUtil.put("http: assertEquals(201, status); HttpURLConnection urlConnection = HttpUtil.get("http: assertEquals(200, urlConnection.getResponseCode()); urlConnection = HttpUtil.delete("http: assertEquals(404, HttpUtil.get("http: }
@DELETE public void deleteElement() throws NotFoundException { LOG.log(Level.FINE, "DELETE element {0}", element); net.sf.ehcache.Cache ehcache = lookupCache(); if (element.equals("*")) { ehcache.removeAll(); } else { boolean removed = ehcache.remove(element); if (!removed) { throw new NotFoundException("Element " + element + " not found"); } } }
ElementResource { @DELETE public void deleteElement() throws NotFoundException { LOG.log(Level.FINE, "DELETE element {0}", element); net.sf.ehcache.Cache ehcache = lookupCache(); if (element.equals("*")) { ehcache.removeAll(); } else { boolean removed = ehcache.remove(element); if (!removed) { throw new NotFoundException("Element " + element + " not found"); } } } }
ElementResource { @DELETE public void deleteElement() throws NotFoundException { LOG.log(Level.FINE, "DELETE element {0}", element); net.sf.ehcache.Cache ehcache = lookupCache(); if (element.equals("*")) { ehcache.removeAll(); } else { boolean removed = ehcache.remove(element); if (!removed) { throw new NotFoundException("Element " + element + " not found"); } } } ElementResource(UriInfo uriInfo, Request request,
                           String cache, String element); }
ElementResource { @DELETE public void deleteElement() throws NotFoundException { LOG.log(Level.FINE, "DELETE element {0}", element); net.sf.ehcache.Cache ehcache = lookupCache(); if (element.equals("*")) { ehcache.removeAll(); } else { boolean removed = ehcache.remove(element); if (!removed) { throw new NotFoundException("Element " + element + " not found"); } } } ElementResource(UriInfo uriInfo, Request request,
                           String cache, String element); @HEAD Response getElementHeader(); @GET Response getElement(); @PUT Response putElement(@Context HttpHeaders headers, byte[] data); @DELETE void deleteElement(); }
ElementResource { @DELETE public void deleteElement() throws NotFoundException { LOG.log(Level.FINE, "DELETE element {0}", element); net.sf.ehcache.Cache ehcache = lookupCache(); if (element.equals("*")) { ehcache.removeAll(); } else { boolean removed = ehcache.remove(element); if (!removed) { throw new NotFoundException("Element " + element + " not found"); } } } ElementResource(UriInfo uriInfo, Request request,
                           String cache, String element); @HEAD Response getElementHeader(); @GET Response getElement(); @PUT Response putElement(@Context HttpHeaders headers, byte[] data); @DELETE void deleteElement();  }