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

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

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

origin: org.restlet.osgi/org.restlet

@Override
public void setExpirationDate(Date expirationDate) {
  getWrappedRepresentation().setExpirationDate(expirationDate);
}
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.restlet.osgi/org.restlet.ext.osgi

  output.setExpirationDate(null);
} else if (timeToLive > 0) {
  output.setExpirationDate(new Date(System
      .currentTimeMillis() + (1000L * timeToLive)));
origin: org.restlet.osgi/org.restlet

  output.setExpirationDate(null);
} else if (timeToLive > 0) {
  output.setExpirationDate(new Date(System
      .currentTimeMillis() + (1000L * timeToLive)));
origin: org.restlet.osgi/org.restlet

  entityHeaderFound = true;
} else if (HEADER_EXPIRES.equalsIgnoreCase(header.getName())) {
  result.setExpirationDate(HeaderReader.readDate(header.getValue(), false));
  entityHeaderFound = true;
} else if (HEADER_CONTENT_ENCODING.equalsIgnoreCase(header.getName())) {
org.restlet.representationRepresentationsetExpirationDate

Javadoc

Sets the future date when this representation expire. If this information is not known, pass null.

Note that when used with HTTP connectors, this property maps to the "Expires" header.

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,
  • setModificationDate,
  • getEncodings,
  • getLocationRef,
  • setTag,
  • exhaust,
  • getDisposition,
  • getTag

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JPanel (javax.swing)
  • Github Copilot alternatives
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