ittp.protocol.request.headers
Class ModifiedSince

java.lang.Object
  extended byittp.protocol.request.Request.Headers
      extended byittp.protocol.request.headers.ModifiedSince

public class ModifiedSince
extends Request.Headers

This class analyse the header Last-Modified send by the client.

Author:
Frederic Bidon and Mathieu Texier

Constructor Summary
ModifiedSince(Request parent)
          Constructor of the class
 
Method Summary
 java.lang.String getModifiedSince()
          Convert to a string the date of the last modification.
 boolean isModifiedSince(long date)
          Compare the date given by the client with the current date of the file.
 boolean isUsed()
          Accessors for the boolean used.
 void setModifiedSince(java.lang.String dateText)
          Mutators for the String dateText.
 java.lang.String toString()
          Convert to a string the headers last-modified send by the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModifiedSince

public ModifiedSince(Request parent)
Constructor of the class

Method Detail

setModifiedSince

public void setModifiedSince(java.lang.String dateText)
                      throws ittpException
Mutators for the String dateText. Check if the format of the date is correct.

Parameters:
dateText - String that contain the date given by the client.
Throws:
ittpException - if the headers If-Modified-Since already received or if the format of the date is incorrect.

isModifiedSince

public boolean isModifiedSince(long date)
Compare the date given by the client with the current date of the file.

Parameters:
date - long that contain the current date of the file.
Returns:
true if the current date is inferior to the date given by the client.

getModifiedSince

public java.lang.String getModifiedSince()
Convert to a string the date of the last modification.

Returns:
a string containing the date of the last modification of the file.

toString

public java.lang.String toString()
Convert to a string the headers last-modified send by the client.

Specified by:
toString in class Request.Headers
Returns:
a string containing the response to this headers if it is used.

isUsed

public boolean isUsed()
Accessors for the boolean used.

Specified by:
isUsed in class Request.Headers
Returns:
used: boolean that determine if this headers is used.