Author: reto
Date: Thu Mar 29 13:06:32 2012
New Revision: 1306832

URL: http://svn.apache.org/viewvc?rev=1306832&view=rev
Log:
removed jcr and sling dependencies

Modified:
    incubator/stanbol/branches/ontonet-showcase/webdav/pom.xml
    
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
    
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
    
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
    
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/RootResource.java

Modified: incubator/stanbol/branches/ontonet-showcase/webdav/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/webdav/pom.xml?rev=1306832&r1=1306831&r2=1306832&view=diff
==============================================================================
--- incubator/stanbol/branches/ontonet-showcase/webdav/pom.xml (original)
+++ incubator/stanbol/branches/ontonet-showcase/webdav/pom.xml Thu Mar 29 
13:06:32 2012
@@ -21,9 +21,9 @@
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.apache.sling</groupId>
-        <artifactId>sling</artifactId>
-        <version>12</version>
+        <groupId>org.apache.stanbol</groupId>
+       <artifactId>stanbol-parent</artifactId>
+       <version>0.9.0-incubating-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stanbol.wedav</artifactId>
@@ -72,40 +72,17 @@
     </build>
     <dependencies>
         <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.api</artifactId>
-            <version>2.2.4</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.auth.core</artifactId>
-            <version>1.0.6</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.mime</artifactId>
-            <version>2.1.4</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.jcr</groupId>
-            <artifactId>jcr</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
-        </dependency>
-        
+        </dependency>   
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.annotations</artifactId>
@@ -132,7 +109,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>

Modified: 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java?rev=1306832&r1=1306831&r2=1306832&view=diff
==============================================================================
--- 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
 (original)
+++ 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
 Thu Mar 29 13:06:32 2012
@@ -19,6 +19,7 @@
 package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
 
 import javax.servlet.ServletException;
+
 import com.bradmcevoy.http.MiltonServlet;
 
 /**

Modified: 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java?rev=1306832&r1=1306831&r2=1306832&view=diff
==============================================================================
--- 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
 (original)
+++ 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
 Thu Mar 29 13:06:32 2012
@@ -33,12 +33,6 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.auth.core.AuthenticationSupport;
-import org.apache.sling.auth.core.spi.AuthenticationHandler;
-import org.apache.sling.commons.mime.MimeTypeService;
 import 
org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources.SlingResourceFactory;
 import org.osgi.service.http.HttpContext;
 import org.osgi.service.http.HttpService;
@@ -78,14 +72,11 @@ public class MiltonDavServlet extends Ab
     /** default log */
     private final Logger log = 
LoggerFactory.getLogger(getClass().getSimpleName());
 
-    @Reference
-    private AuthenticationSupport slingAuthenticator;
 
     @Reference
     private HttpService osgiHttpService;
 
-    @Reference(policy = ReferencePolicy.DYNAMIC, cardinality = 
ReferenceCardinality.OPTIONAL_UNARY)
-    private MimeTypeService mimeTypeService;
+
 
     // the actual prefix under which the servlet is registered, only non-null
     // if the servlet is actually registered with the Http Service
@@ -110,10 +101,7 @@ public class MiltonDavServlet extends Ab
             }
             super.service(servletRequest, servletResponse);
         } finally {
-            Object resolver = 
servletRequest.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
-            if (resolver instanceof ResourceResolver) {
-                ((ResourceResolver) resolver).close();
-            }
+            
         }
     }
 
@@ -152,11 +140,12 @@ public class MiltonDavServlet extends Ab
 
             public boolean handleSecurity(HttpServletRequest request,
                     HttpServletResponse response) throws IOException {
-                if (authRequired) {
+                /*if (authRequired) {
                     request.setAttribute(
                         AuthenticationHandler.REQUEST_LOGIN_PARAMETER, 
"Basic");
                 }
-                return slingAuthenticator.handleSecurity(request, response);
+                return slingAuthenticator.handleSecurity(request, response);*/
+               return true;
             }
 
             // this context provides no resources, always call the servlet
@@ -165,8 +154,7 @@ public class MiltonDavServlet extends Ab
             }
 
             public String getMimeType(String name) {
-                MimeTypeService mts = MiltonDavServlet.this.mimeTypeService;
-                return (mts != null) ? mts.getMimeType(name) : null;
+                return null;
             }
         };
 

Modified: 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java?rev=1306832&r1=1306831&r2=1306832&view=diff
==============================================================================
--- 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
 (original)
+++ 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
 Thu Mar 29 13:06:32 2012
@@ -18,10 +18,7 @@
  */
 package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
 
-import org.apache.sling.auth.core.AuthenticationSupport;
-
 import com.bradmcevoy.http.AuthenticationHandler;
-import com.bradmcevoy.http.MiltonServlet;
 import com.bradmcevoy.http.Request;
 import com.bradmcevoy.http.Resource;
 
@@ -37,26 +34,17 @@ public class SlingAuthenticationHandler 
     static final String NAME = 
"org.apache.sling.whiteboard.fmeschbe.miltondav.impl.SlingAuthenticationHandler";
 
     /**
-     * Returns <code>true</code> if the current request has successfully been
-     * authenticated and the Sling <code>ResourceResolver</code> is available
-     * for request processing. This is generally the case, so we can assume 
this
-     * method will always return <code>true</code>.
+     * Returns <code>true</code>
      */
     public boolean supports(Resource r, Request request) {
-        return getResourceResolver() != null;
+        return true;
     }
 
     /**
-     * Returns the Sling <code>ResourceResolver</code> created during Sling
-     * request authentication.
-     * <p>
-     * This method will only be called if the
-     * {@link #supports(Resource, Request)} method of this implementation has
-     * already been called and returned <code>true</code> in which case the
-     * result of this method is never <code>null</code>.
+     * Returns a constant string
      */
     public Object authenticate(Resource resource, Request request) {
-        return getResourceResolver();
+        return "good user";
     }
 
     /**
@@ -75,12 +63,4 @@ public class SlingAuthenticationHandler 
         return true;
     }
 
-    /**
-     * Returns the Sling <code>ResourceResolver</code> from the request
-     * attribute.
-     */
-    private Object getResourceResolver() {
-        return MiltonServlet.request().getAttribute(
-            AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
-    }
 }

Modified: 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/RootResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/RootResource.java?rev=1306832&r1=1306831&r2=1306832&view=diff
==============================================================================
--- 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/RootResource.java
 (original)
+++ 
incubator/stanbol/branches/ontonet-showcase/webdav/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/RootResource.java
 Thu Mar 29 13:06:32 2012
@@ -1,26 +1,15 @@
 package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.commons.io.IOUtils;
-
-import com.bradmcevoy.common.Path;
 import com.bradmcevoy.http.Auth;
 import com.bradmcevoy.http.CollectionResource;
 import com.bradmcevoy.http.PropFindableResource;
-import com.bradmcevoy.http.PutableResource;
 import com.bradmcevoy.http.Request;
 import com.bradmcevoy.http.Request.Method;
 import com.bradmcevoy.http.Resource;
-import com.bradmcevoy.http.ResourceFactory;
-import com.bradmcevoy.http.exceptions.BadRequestException;
-import com.bradmcevoy.http.exceptions.ConflictException;
-import com.bradmcevoy.http.exceptions.NotAuthorizedException;
 
 public class RootResource implements PropFindableResource, CollectionResource {
  


Reply via email to