Rev 1250 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1248 | dev | 1 | package ak.photoalbum.webapp; |
2 | |||
3 | import java.io.InputStream; |
||
4 | import javax.servlet.ServletContext; |
||
1250 | dev | 5 | import ak.photoalbum.util.ResourceFactory; |
1248 | dev | 6 | |
7 | public class ServletResourceFactory |
||
8 | implements ResourceFactory |
||
9 | { |
||
1274 | dev | 10 | private final ServletContext servletContext; |
1248 | dev | 11 | |
12 | public ServletResourceFactory(ServletContext servletContext) |
||
13 | { |
||
14 | this.servletContext = servletContext; |
||
15 | } |
||
16 | |||
17 | public InputStream getAsStream(String path) |
||
18 | { |
||
19 | return servletContext.getResourceAsStream("/" + path); |
||
20 | } |
||
21 | } |
||
22 |