Tabnine Logo
Representation.setModificationDate
Code IndexAdd Tabnine to your IDE (free)

How to use
setModificationDate
method
in
org.restlet.representation.Representation

Best Java code snippets using org.restlet.representation.Representation.setModificationDate (Showing top 10 results out of 315)

origin: org.restlet.osgi/org.restlet

@Override
public void setModificationDate(Date modificationDate) {
  getWrappedRepresentation().setModificationDate(modificationDate);
}
origin: apache/attic-polygene-java

private Representation entityHeaders( Representation representation, EntityState entityState )
{
  representation.setModificationDate( java.util.Date.from( entityState.lastModified() ) );
  representation.setTag( new Tag( "" + entityState.version() ) );
  representation.setCharacterSet( CharacterSet.UTF_8 );
  representation.setLanguages( Collections.singletonList( Language.ENGLISH ) );
  return representation;
}
origin: org.restlet.jse/org.restlet.example

@Get
public Representation represent() {
  // Modification date (Fri, 17 Apr 2012 10:10:10 GMT) unchanged.
  Calendar cal = new GregorianCalendar(2012, 4, 17, 10, 10, 10);
  Representation result = new StringRepresentation("<a href="
      + getReference() + ">" + System.currentTimeMillis() + "</a>");
  result.setMediaType(MediaType.TEXT_HTML);
  result.setModificationDate(cal.getTime());
  // Expiration date (Fri, 17 Apr 2012 13:10:10 GMT) unchanged.
  cal.roll(Calendar.HOUR, 3);
  result.setExpirationDate(cal.getTime());
  // Setting E-Tag
  result.setTag(new Tag("xyz123"));
  // Setting a cache directive
  getResponse().getCacheDirectives().add(CacheDirective.publicInfo());
  return result;
}
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Tag tag = new Tag( state.entityReference().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( java.util.Date.from( state.lastModified() ) );
    response.getEntity().setTag( tag );
  }
}
origin: apache/attic-polygene-java

void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Tag tag = new Tag( state.entityReference().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( java.util.Date.from( state.lastModified() ) );
    response.getEntity().setTag( tag );
  }
}
origin: org.restlet.osgi/org.restlet.ext.osgi

    metadataService.getDefaultMediaType());
output.setLocationRef(request.getResourceRef());
output.setModificationDate(modificationDate);
origin: org.qi4j.library/org.qi4j.library.rest-server

public void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Date lastModified = new Date( state.lastModified() );
    Tag tag = new Tag( state.identity().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( lastModified );
    response.getEntity().setTag( tag );
  }
}
origin: org.restlet.osgi/org.restlet

    metadataService.getDefaultMediaType());
output.setLocationRef(request.getResourceRef());
output.setModificationDate(modificationDate);
origin: org.restlet.osgi/org.restlet

/**
 * Constructor from a variant.
 * 
 * @param variant
 *            The variant to copy.
 * @param modificationDate
 *            The modification date.
 * @param tag
 *            The tag.
 */
public Representation(Variant variant, Date modificationDate, Tag tag) {
  setCharacterSet(variant.getCharacterSet());
  setEncodings(variant.getEncodings());
  setLocationRef(variant.getLocationRef());
  setLanguages(variant.getLanguages());
  setMediaType(variant.getMediaType());
  setModificationDate(modificationDate);
  setTag(tag);
}
origin: org.restlet.osgi/org.restlet

  entityHeaderFound = true;
} else if (HEADER_LAST_MODIFIED.equalsIgnoreCase(header.getName())) {
  result.setModificationDate(HeaderReader.readDate(header.getValue(), false));
  entityHeaderFound = true;
} else if (HEADER_ETAG.equalsIgnoreCase(header.getName())) {
org.restlet.representationRepresentationsetModificationDate

Popular methods of Representation

  • getMediaType
  • getStream
    Returns a stream with the representation's content. This method is ensured to return a fresh stream
  • getText
    Converts the representation to a string value. Be careful when using this method as the conversion o
  • isAvailable
    Indicates if some fresh content is potentially available, without having to actually call one of the
  • write
    Writes the representation to a byte channel. This method is ensured to write the full content for ea
  • setMediaType
  • getCharacterSet
  • getReader
    Returns a characters reader with the representation's content. This method is ensured to return a fr
  • getSize
    Returns the total size in bytes if known, UNKNOWN_SIZE (-1) otherwise. When ranges are used, this mi
  • setCharacterSet
  • getModificationDate
  • release
    Releases the representation and all associated objects like streams, channels or files which are use
  • getModificationDate,
  • release,
  • getLanguages,
  • getEncodings,
  • getLocationRef,
  • setTag,
  • exhaust,
  • getDisposition,
  • getTag

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • findViewById (Activity)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now