Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/handler/ResourceHandler.java @ 820:8e9db0bbf4f9
remove org.eclipse.jetty.util.log and upgrade slf4j
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 13 Sep 2016 23:13:06 -0600 |
parents | fc3e366caa51 |
children | 0048a843297a |
comparison
equal
deleted
inserted
replaced
819:17bd0b170ed6 | 820:8e9db0bbf4f9 |
---|---|
38 import org.eclipse.jetty.server.Dispatcher; | 38 import org.eclipse.jetty.server.Dispatcher; |
39 import org.eclipse.jetty.server.Request; | 39 import org.eclipse.jetty.server.Request; |
40 import org.eclipse.jetty.server.Response; | 40 import org.eclipse.jetty.server.Response; |
41 import org.eclipse.jetty.server.handler.ContextHandler.Context; | 41 import org.eclipse.jetty.server.handler.ContextHandler.Context; |
42 import org.eclipse.jetty.util.URIUtil; | 42 import org.eclipse.jetty.util.URIUtil; |
43 import org.eclipse.jetty.util.log.Log; | 43 import org.slf4j.Logger; |
44 import org.eclipse.jetty.util.log.Logger; | 44 import org.slf4j.LoggerFactory; |
45 import org.eclipse.jetty.util.resource.FileResource; | 45 import org.eclipse.jetty.util.resource.FileResource; |
46 import org.eclipse.jetty.util.resource.Resource; | 46 import org.eclipse.jetty.util.resource.Resource; |
47 | 47 |
48 | 48 |
49 /* ------------------------------------------------------------ */ | 49 /* ------------------------------------------------------------ */ |
56 * | 56 * |
57 * @org.apache.xbean.XBean | 57 * @org.apache.xbean.XBean |
58 */ | 58 */ |
59 public class ResourceHandler extends HandlerWrapper | 59 public class ResourceHandler extends HandlerWrapper |
60 { | 60 { |
61 private static final Logger LOG = Log.getLogger(ResourceHandler.class); | 61 private static final Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); |
62 | 62 |
63 ContextHandler _context; | 63 ContextHandler _context; |
64 Resource _baseResource; | 64 Resource _baseResource; |
65 Resource _defaultStylesheet; | 65 Resource _defaultStylesheet; |
66 Resource _stylesheet; | 66 Resource _stylesheet; |
207 setBaseResource(Resource.newResource(resourceBase)); | 207 setBaseResource(Resource.newResource(resourceBase)); |
208 } | 208 } |
209 catch (Exception e) | 209 catch (Exception e) |
210 { | 210 { |
211 LOG.warn(e.toString()); | 211 LOG.warn(e.toString()); |
212 LOG.debug(e); | 212 LOG.debug("",e); |
213 throw new IllegalArgumentException(resourceBase); | 213 throw new IllegalArgumentException(resourceBase); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 /* ------------------------------------------------------------ */ | 217 /* ------------------------------------------------------------ */ |
233 _defaultStylesheet = Resource.newResource(this.getClass().getResource("/org/eclipse/jetty/jetty-dir.css")); | 233 _defaultStylesheet = Resource.newResource(this.getClass().getResource("/org/eclipse/jetty/jetty-dir.css")); |
234 } | 234 } |
235 catch(IOException e) | 235 catch(IOException e) |
236 { | 236 { |
237 LOG.warn(e.toString()); | 237 LOG.warn(e.toString()); |
238 LOG.debug(e); | 238 LOG.debug("",e); |
239 } | 239 } |
240 } | 240 } |
241 return _defaultStylesheet; | 241 return _defaultStylesheet; |
242 } | 242 } |
243 } | 243 } |
258 } | 258 } |
259 } | 259 } |
260 catch(Exception e) | 260 catch(Exception e) |
261 { | 261 { |
262 LOG.warn(e.toString()); | 262 LOG.warn(e.toString()); |
263 LOG.debug(e); | 263 LOG.debug("",e); |
264 throw new IllegalArgumentException(stylesheet.toString()); | 264 throw new IllegalArgumentException(stylesheet.toString()); |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 /* ------------------------------------------------------------ */ | 268 /* ------------------------------------------------------------ */ |
306 path=URIUtil.canonicalPath(path); | 306 path=URIUtil.canonicalPath(path); |
307 return base.addPath(path); | 307 return base.addPath(path); |
308 } | 308 } |
309 catch(Exception e) | 309 catch(Exception e) |
310 { | 310 { |
311 LOG.ignore(e); | 311 LOG.trace("",e); |
312 } | 312 } |
313 | 313 |
314 return null; | 314 return null; |
315 } | 315 } |
316 | 316 |