/** * Indicates if there are some conditions set. * * @return True if there are some conditions set. */ public boolean hasSome() { return (((this.match != null) && !this.match.isEmpty()) || ((this.noneMatch != null) && !this.noneMatch.isEmpty()) || (getModifiedSince() != null) || (getUnmodifiedSince() != null)); }
Conditions c=new Conditions(); String[] arr=null; arr=inout; IncentiveProLog.insertLog(" Class has been generated as "+c.toString(),id); try
/** * Returns the conditional status of a variant using a given method. * * @param method * The request method. * @param representationInfo * The representation information that will be tested. * @return Null if the requested method can be performed, the status of the * response otherwise. */ public Status getStatus(Method method, RepresentationInfo representationInfo) { return getStatus( method, representationInfo != null, (representationInfo == null) ? null : representationInfo .getTag(), (representationInfo == null) ? null : representationInfo.getModificationDate()); }
conditions = new Conditions(); for (Tag o : request.getConditions().getMatch()) { conditions.getMatch().add(o); conditions.setModifiedSince(request.getConditions().getModifiedSince()); for (Tag o : request.getConditions().getNoneMatch()) { conditions.getNoneMatch().add(o); conditions.setRangeDate(request.getConditions().getRangeDate()); conditions.setRangeTag(request.getConditions().getRangeTag()); conditions.setUnmodifiedSince(request.getConditions() .getUnmodifiedSince());
boolean matched = false; boolean failed = false; boolean all = (getMatch().size() > 0) && getMatch().get(0).equals(Tag.ALL); String statusMessage = null; for (Iterator<Tag> iter = getMatch().iterator(); !matched && iter.hasNext();) { matchTag = iter.next(); for (Iterator<Tag> iter = getNoneMatch().iterator(); !matched && iter.hasNext();) { noneMatchTag = iter.next(); Date modifiedSince = getModifiedSince(); boolean isModifiedSince = (modifiedSince != null) && (DateUtils.after(new Date(), modifiedSince) matched = (getNoneMatch().size() > 0) && Tag.ALL.equals(getNoneMatch().get(0)); if ((result == null) && (getModifiedSince() != null)) { Date modifiedSince = getModifiedSince(); boolean isModifiedSince = (DateUtils.after(new Date(), modifiedSince) || (modificationDate == null) || DateUtils if ((result == null) && (getUnmodifiedSince() != null)) { Date unModifiedSince = getUnmodifiedSince(); boolean isUnModifiedSince = ((unModifiedSince == null)
addHeader(HEADER_IF_MATCH, TagWriter.write(conditions.getMatch()), headers); addHeader(HEADER_IF_NONE_MATCH, TagWriter.write(conditions.getNoneMatch()), headers); if (conditions.getModifiedSince() != null) { addHeader(HEADER_IF_MODIFIED_SINCE, DateWriter.write(conditions.getModifiedSince()), headers); if (conditions.getRangeTag() != null && conditions.getRangeDate() != null) { Context.getCurrentLogger() .log(WARNING, "Unable to format the HTTP If-Range header due to the presence of both entity tag and modification date."); } else if (conditions.getRangeTag() != null) { addHeader(HEADER_IF_RANGE, TagWriter.write(conditions.getRangeTag()), headers); } else if (conditions.getRangeDate() != null) { addHeader(HEADER_IF_RANGE, DateWriter.write(conditions.getRangeDate()), headers); if (conditions.getUnmodifiedSince() != null) { addHeader(HEADER_IF_UNMODIFIED_SINCE, DateWriter.write(conditions.getUnmodifiedSince()), headers);
throws ResourceException if ( req.getConditions().getModifiedSince() != null ) if ( file.getModified() > req.getConditions().getModifiedSince().getTime() ) else if ( req.getConditions().getNoneMatch() != null && req.getConditions().getNoneMatch().size() > 0 && file.getRepositoryItemAttributes().containsKey( DigestCalculatingInspector.DIGEST_SHA1_KEY ) ) Tag tag = req.getConditions().getNoneMatch().get( 0 );
result.setModifiedSince(ifModifiedSince); result.setUnmodifiedSince(ifUnmodifiedSince); new TagReader(ifMatchHeader).addValues(result.getMatch()); } catch (Exception e) { this.context.getLogger().log( new TagReader(ifNoneMatchHeader).addValues(result.getNoneMatch()); } catch (Exception e) { this.context.getLogger().log( result.setRangeTag(tag); } else { Date date = HeaderReader.readDate(ifRangeHeader, false); result.setRangeDate(date);
resource.getConditions().setModifiedSince(rep.getModificationDate()); rep = resource.get(); System.out.println(resource.getStatus()); resource.getConditions().setModifiedSince(null); resource.getConditions().getNoneMatch().add(new Tag("xyz123")); rep = resource.get(); System.out.println(resource.getStatus()); resource.getConditions().getNoneMatch().clear(); resource.getConditions().getMatch().add(rep.getTag()); resource.put(rep); System.out.println(resource.getStatus()); resource.getConditions().getMatch().clear(); resource.getConditions().getMatch().add(new Tag("abcd7890")); resource.put(rep); System.out.println(resource.getStatus());
java.util.Date lastModified = getRequest().getConditions().getModifiedSince(); if( lastModified != null )
/** * Returns the modifiable conditions applying to this request. Creates a new * instance if no one has been set. * * @return The conditions applying to this call. */ public Conditions getConditions() { // Lazy initialization with double-check. Conditions c = this.conditions; if (c == null) { synchronized (this) { c = this.conditions; if (c == null) { this.conditions = c = new Conditions(); } } } return c; }
public void updateQueryConditions( Request request ) { String identity = pathToIdentity.get( getIdentityPath( request.getResourceRef() ) ); if( identity != null ) { CacheInfo cacheInfo = identityToTimestamp.get( identity ); if( cacheInfo != null ) { // LoggerFactory.getLogger( ClientCache.class ).info( "Send: "+cacheInfo.getEntity()+" ("+request.getMethod().getName()+":"+request.getResourceRef()+") -> "+cacheInfo.getLastModified() ); request.getConditions().setModifiedSince( from( cacheInfo.getLastModified() ) ); } } }
boolean matched = false; boolean failed = false; final boolean all = getMatch().get(0).equals(Tag.ALL); for (final Iterator<Tag> iter = getMatch().iterator(); !matched && iter.hasNext();) { tag = iter.next(); for (final Iterator<Tag> iter = getNoneMatch().iterator(); !matched && iter.hasNext();) { tag = iter.next(); final Date modifiedSince = getModifiedSince(); final boolean isModifiedSince = (modifiedSince != null) && (DateUtils.after(new Date(), modifiedSince) matched = getNoneMatch().get(0).equals(Tag.ALL); if ((result == null) && (getModifiedSince() != null)) { if (representation != null) { final Date modifiedSince = getModifiedSince(); final boolean isModifiedSince = (DateUtils.after(new Date(), modifiedSince) if ((result == null) && (getUnmodifiedSince() != null)) { if (representation != null) { final Date unModifiedSince = getUnmodifiedSince(); final boolean isUnModifiedSince = ((unModifiedSince == null) || (representation.getModificationDate() == null) || !DateUtils
if (request.getConditions().getModifiedSince() != null) { result.setIfModifiedSince(request.getConditions().getModifiedSince().getTime()); if (request.getConditions().getNoneMatch() != null && request.getConditions().getNoneMatch().size() > 0) { final Tag tag = request.getConditions().getNoneMatch().get(0);
/** * Returns the modifiable conditions applying to this request. Creates a new * instance if no one has been set. * * @return The conditions applying to this call. */ public Conditions getConditions() { // Lazy initialization with double-check. Conditions c = this.conditions; if (c == null) { synchronized (this) { c = this.conditions; if (c == null) { this.conditions = c = new Conditions(); } } } return c; }
/** * Indicates if there are some conditions set. * * @return True if there are some conditions set. */ public boolean hasSome() { return (((this.match != null) && !this.match.isEmpty()) || ((this.noneMatch != null) && !this.noneMatch.isEmpty()) || (getModifiedSince() != null) || (getUnmodifiedSince() != null)); }
if ( request.getConditions().getModifiedSince() != null ) result.setIfModifiedSince( request.getConditions().getModifiedSince().getTime() ); if ( request.getConditions().getNoneMatch() != null && request.getConditions().getNoneMatch().size() > 0 ) Tag tag = request.getConditions().getNoneMatch().get( 0 );