Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2010 Regents of the University of California and the
4
 *              National Center for Ecological Analysis and Synthesis
5
 *
6
 *   '$Author: berkley $'
7
 *     '$Date: 2009-06-13 13:28:21 +0300  $'
8
 *
9
 * This program is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 2 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
 */
23

    
24
package edu.ucsb.nceas.metacat.restservice;
25

    
26

    
27
import org.apache.commons.logging.Log;
28
import org.apache.commons.logging.LogFactory;
29

    
30
import java.io.IOException;
31

    
32
import javax.servlet.Filter;
33
import javax.servlet.FilterChain;
34
import javax.servlet.FilterConfig;
35
import javax.servlet.ServletContext;
36
import javax.servlet.ServletException;
37
import javax.servlet.ServletRequest;
38
import javax.servlet.ServletResponse;
39

    
40

    
41
/**
42
 * @author berkley
43
 *
44
 */
45
public class D1URLFilter implements Filter
46
{
47
    ServletContext context;
48
    private static Log logger = LogFactory.getLog(D1URLFilter.class);
49
    
50
    public void init(FilterConfig filterConfig) 
51
    {
52
        logger.debug("D1URLFilter init.");
53
        this.context = filterConfig.getServletContext();
54
    }
55
    
56
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 
57
        throws IOException, ServletException 
58
    {
59
        logger.debug("In D1URLFilter.");
60
        D1HttpRequest d1h = new D1HttpRequest(request);
61
        chain.doFilter(d1h, response);
62
    }
63
    
64
    public void destroy() 
65
    {
66
        logger.debug("D1URLFilter destroy.");
67
    }
68
}
(4-4/5)