Author: thorsten
Date: Wed Sep 17 04:32:28 2008
New Revision: 696253
URL: http://svn.apache.org/viewvc?rev=696253&view=rev
Log:
Adding a first Resolver implementation that will look up a resource in the
classpath. This implemention is used in the junit tests
Added:
forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java
(with props)
Added:
forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java?rev=696253&view=auto
==============================================================================
---
forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java
(added)
+++
forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java
Wed Sep 17 04:32:28 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.forrest.dispatcher.impl;
+
+import java.io.InputStream;
+
+import org.apache.forrest.dispatcher.api.Resolver;
+
+public class ClassPathResolver implements Resolver {
+
+ public InputStream resolve(String uri) {
+ InputStream stream=this.getClass().getResourceAsStream(uri);
+ return stream;
+ }
+
+}
Propchange:
forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/ClassPathResolver.java
------------------------------------------------------------------------------
svn:eol-style = native