Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

infranet
Class InfranetFilter  view InfranetFilter download InfranetFilter.java

java.lang.Object
  extended byinfranet.InfranetFilter
All Implemented Interfaces:
javax.servlet.Filter

public class InfranetFilter
extends java.lang.Object
implements javax.servlet.Filter


Nested Class Summary
private static class InfranetFilter.ClientState
           
 
Field Summary
private static java.lang.String capPath
           
private static java.lang.String cdfPath
           
private static javax.servlet.ServletContext context
           
private static int DEMOD
           
private static java.lang.String docBase
           
private static int fileCount
           
private static boolean first
           
private static java.lang.String initialKey
           
private static java.util.Map maxBytes
           
private static java.lang.String rsaPath
           
private static boolean SAVE_DATA
           
private static int SERVE
           
private static int SHARED_KEY
           
private static int SOCKET_TIMEOUT
           
private static java.lang.String symPath
           
private static int UPDATE
           
private static java.lang.String urlPath
           
 
Constructor Summary
InfranetFilter()
           
 
Method Summary
 void destroy()
          Called by the web container to indicate to a filter that it is being taken out of service.
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
          The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.
private static byte[] fetchRequest(Request req)
           
private static java.lang.String getFileName()
           
private static java.lang.String getStegoKey(java.lang.String seed)
           
 void init(javax.servlet.FilterConfig config)
          Called by the web container to indicate to a filter that it is being placed into service.
private static void init2(java.lang.String contextPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_DATA

private static final boolean SAVE_DATA
See Also:
Constant Field Values

SOCKET_TIMEOUT

private static final int SOCKET_TIMEOUT
See Also:
Constant Field Values

SHARED_KEY

private static final int SHARED_KEY
See Also:
Constant Field Values

UPDATE

private static final int UPDATE
See Also:
Constant Field Values

DEMOD

private static final int DEMOD
See Also:
Constant Field Values

SERVE

private static final int SERVE
See Also:
Constant Field Values

initialKey

private static java.lang.String initialKey

docBase

private static java.lang.String docBase

maxBytes

private static java.util.Map maxBytes

cdfPath

private static final java.lang.String cdfPath
See Also:
Constant Field Values

urlPath

private static final java.lang.String urlPath
See Also:
Constant Field Values

symPath

private static final java.lang.String symPath
See Also:
Constant Field Values

capPath

private static final java.lang.String capPath
See Also:
Constant Field Values

rsaPath

private static final java.lang.String rsaPath
See Also:
Constant Field Values

context

private static javax.servlet.ServletContext context

first

private static boolean first

fileCount

private static int fileCount
Constructor Detail

InfranetFilter

public InfranetFilter()
Method Detail

getFileName

private static java.lang.String getFileName()

init

public void init(javax.servlet.FilterConfig config)
Description copied from interface: javax.servlet.Filter
Called by the web container to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter. The init method must complete successfully before the filter is asked to do any filtering work.

The web container cannot place the filter into service if the init method either
1.Throws a ServletException
2.Does not return within a time period defined by the web container

Specified by:
init in interface javax.servlet.Filter

init2

private static void init2(java.lang.String contextPath)
                   throws java.io.FileNotFoundException,
                          java.io.IOException

destroy

public void destroy()
Description copied from interface: javax.servlet.Filter
Called by the web container to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter.

This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse res,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Description copied from interface: javax.servlet.Filter
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. The FilterChain passed in to this method allows the Filter to pass on the request and response to the next entity in the chain.

A typical implementation of this method would follow the following pattern:-
1. Examine the request
2. Optionally wrap the request object with a custom implementation to filter content or headers for input filtering
3. Optionally wrap the response object with a custom implementation to filter content or headers for output filtering
4. a) Either invoke the next entity in the chain using the FilterChain object (chain.doFilter()),
4. b) or not pass on the request/response pair to the next entity in the filter chain to block the request processing
5. Directly set headers on the response after invocation of the next entity in the filter chain.

Specified by:
doFilter in interface javax.servlet.Filter

fetchRequest

private static byte[] fetchRequest(Request req)
                            throws java.lang.Exception

getStegoKey

private static java.lang.String getStegoKey(java.lang.String seed)