1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.http.server.glue;
12
13 import javax.servlet.http.HttpServletRequest;
14 import javax.servlet.http.HttpServletRequestWrapper;
15
16
17
18
19 public class WrappedRequest extends HttpServletRequestWrapper {
20 private final String path;
21
22 private final String pathInfo;
23
24
25
26
27
28
29
30
31
32
33
34 public WrappedRequest(final HttpServletRequest originalRequest,
35 final String path, final String pathInfo) {
36 super(originalRequest);
37 this.path = path;
38 this.pathInfo = pathInfo;
39 }
40
41
42 @Override
43 public String getPathTranslated() {
44 final String p = getPathInfo();
45 return p != null ? getSession().getServletContext().getRealPath(p) : null;
46 }
47
48
49 @Override
50 public String getPathInfo() {
51 return pathInfo;
52 }
53
54
55 @Override
56 public String getServletPath() {
57 return path;
58 }
59 }