All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.http.LookupState

java.lang.Object
   |
   +----w3c.jigsaw.http.LookupState

public class LookupState
extends Object
This object keeps the state info around while looking up an entity. For more informations on the lookup process itself, see the ContainerEntity in this package.

See Also:
ContainerEntity

Constructor Index

 o LookupState(Request)
Create a lookup state to handle the given request on behalf of client.
 o LookupState(String)
Construct a lookup state to be resolved internnaly by the server.

Method Index

 o countRemainingComponents()
How much components have not yet been looked up in this state.
 o getFragment()
Get the fragment part of the URL, if any.
 o getNextComponent()
Get next part of the URL to be look for.
 o getQuery()
Get the query part of the URL, if any.
 o getRemainingPath()
Get the remaiing path, without consuming it.
 o getRemainingPath(boolean)
Get the remaining path.
 o getRequest()
Get this lookup state request.
 o getURI()
Get this lookpu state full URI.
 o hasMoreComponents()
Does this look up state has more components to be looked for.
 o hasRequest()
Is this lookup state object associated with a request ?
 o isDirectory()
Is the requested URI a directory URI ?
 o isInternal()
Is this lookup state internal to the server.
 o markInternal()
Mark this lookup state as being done internally.
 o parseURI()
Parse the given http URI into an array of hierarchical components.
 o peekNextComponent()
Get the next component, without consuming it.
 o unescape(String)
Unescape a HTTP escaped string

Constructors

 o LookupState
 public LookupState(Request request) throws HTTPException
Create a lookup state to handle the given request on behalf of client.

Parameters:
client - The client that issued the request.
request - The request whose URI is to bee looked up.
 o LookupState
 public LookupState(String uri) throws HTTPException
Construct a lookup state to be resolved internnaly by the server. This method allows for internal lookup of object, even if there is no real client making the request.

Parameters:
uri - The URI to be looked up.

Methods

 o unescape
 public static String unescape(String s)
Unescape a HTTP escaped string

Parameters:
s - The string to be unescaped
Returns:
the unescaped string.
 o parseURI
 protected void parseURI() throws HTTPException
Parse the given http URI into an array of hierarchical components. The optional query string and an optional fragment are recorded into the request as new fields.

The query string and the fragment are recorded into the request as the query and frag attributes.

 o getFragment
 public String getFragment()
Get the fragment part of the URL, if any. The fragment is anything beyond the # character in a URL.

Returns:
A String instance, or null.
 o getQuery
 public String getQuery()
Get the query part of the URL, if any. The query is anything beyond a ? character in a URL.

Returns:
A String instance, or null.
 o isDirectory
 public boolean isDirectory()
Is the requested URI a directory URI ?

Returns:
A boolean true if the requested URI ends with a slash, false otherwise.
 o getURI
 public String getURI()
Get this lookpu state full URI.

 o getNextComponent
 public final String getNextComponent()
Get next part of the URL to be look for.

Returns:
A String giving the next component.
 o peekNextComponent
 public final String peekNextComponent()
Get the next component, without consuming it.

Returns:
A String giving the next component, or null if none is available.
 o getRemainingPath
 public final String getRemainingPath(boolean consume)
Get the remaining path.

Parameters:
consume - If true, consume the components, otherwise, just peek them.
Returns:
A String giving the remaining URL.
 o getRemainingPath
 public final String getRemainingPath()
Get the remaiing path, without consuming it.

Returns:
The remaining path.
 o hasMoreComponents
 public boolean hasMoreComponents()
Does this look up state has more components to be looked for.

Returns:
true if more components are to be looked for.
 o countRemainingComponents
 public int countRemainingComponents()
How much components have not yet been looked up in this state.

 o getRequest
 public final Request getRequest()
Get this lookup state request.

Returns:
An instance of Request, or null if this is an internal request.
 o hasRequest
 public boolean hasRequest()
Is this lookup state object associated with a request ?

Returns:
A boolean true if a request is associated.
 o markInternal
 public void markInternal()
Mark this lookup state as being done internally. This allows lookup methods to be more kind (for example, not throwing redirections error, etc).

 o isInternal
 public boolean isInternal()
Is this lookup state internal to the server. Internal lookup state may not have an associated request.

Returns:
A boolean true if this is an internal request.

All Packages  Class Hierarchy  This Package  Previous  Next  Index