@Override public Tag getTag() { return getWrappedRepresentation().getTag(); }
public static void main(String[] args) throws Exception { ClientResource resource = new ClientResource("http://localhost:8111/"); // Get a representation Representation rep = resource.get(); // Display caching metadata System.out.println("Modified: " + rep.getModificationDate()); System.out.println("Expires: " + rep.getExpirationDate()); System.out.println("E-Tag: " + rep.getTag()); } }
/** * Adds the entity headers based on the {@link Representation} to the {@link Series} when a 304 (Not Modified) * status is returned. * * @param entity * The source entity {@link Representation}. * @param headers * The target headers {@link Series}. */ public static void addNotModifiedEntityHeaders(Representation entity, Series<Header> headers) { if (entity != null) { if (entity.getTag() != null) { addHeader(HEADER_ETAG, TagWriter.write(entity.getTag()), headers); } if (entity.getLocationRef() != null) { addHeader(HEADER_CONTENT_LOCATION, entity.getLocationRef().getTargetRef().toString(), headers); } } }
.equals( Method.POST ) ) Tag tag = response.getEntity().getTag(); if( tag != null )
resource.getConditions().getMatch().add(rep.getTag()); resource.put(rep); System.out.println(resource.getStatus());
return (entity != null && entity.getSize() != -1) ? Long.toString(entity.getSize()) : null; case "et": return (entity != null && entity.getTag() != null) ? entity.getTag().getName() : null; case "m": return (this.request.getMethod() != null) ? this.request.getMethod().getName() : null; return (entity != null && entity.getSize() != -1) ? Long.toString(entity.getSize()) : null; case "ET": return (entity != null && entity.getTag() != null) ? entity.getTag().getName() : null; case "S": return (status != null) ? Integer.toString(status.getCode()) : null;