incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1209340 - in /sling/trunk: bundles/extensions/fsresource/pom.xml bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java launchpad/builder/src/main/bundles/list.xml
Date Fri, 02 Dec 2011 02:56:28 GMT
Author: justin
Date: Fri Dec  2 02:56:26 2011
New Revision: 1209340

URL: http://svn.apache.org/viewvc?rev=1209340&view=rev
Log:
SLING-2312 - adding adapter annotations for fsresource bundle

Modified:
    sling/trunk/bundles/extensions/fsresource/pom.xml
    sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
    sling/trunk/launchpad/builder/src/main/bundles/list.xml

Modified: sling/trunk/bundles/extensions/fsresource/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/pom.xml?rev=1209340&r1=1209339&r2=1209340&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/pom.xml (original)
+++ sling/trunk/bundles/extensions/fsresource/pom.xml Fri Dec  2 02:56:26 2011
@@ -52,6 +52,20 @@
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>maven-sling-plugin</artifactId>
+                <version>2.0.7-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <id>generate-adapter-metadata</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>generate-adapter-metadata</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
@@ -104,5 +118,11 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>adapter-annotations</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java?rev=1209340&r1=1209339&r2=1209340&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
(original)
+++ sling/trunk/bundles/extensions/fsresource/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
Fri Dec  2 02:56:26 2011
@@ -25,6 +25,8 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import org.apache.sling.adapter.annotations.Adaptable;
+import org.apache.sling.adapter.annotations.Adapter;
 import org.apache.sling.api.resource.AbstractResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
@@ -36,6 +38,10 @@ import org.slf4j.LoggerFactory;
  * The <code>FsResource</code> represents a file system file or folder as
  * a Sling Resource.
  */
+@Adaptable(adaptableClass=Resource.class, adapters={
+    @Adapter({File.class, URL.class}),
+    @Adapter(condition="If the resource is an FsResource and is a readable file.", value=InputStream.class)
+})
 public class FsResource extends AbstractResource implements Resource {
 
     /**

Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/src/main/bundles/list.xml?rev=1209340&r1=1209339&r2=1209340&view=diff
==============================================================================
--- sling/trunk/launchpad/builder/src/main/bundles/list.xml (original)
+++ sling/trunk/launchpad/builder/src/main/bundles/list.xml Fri Dec  2 02:56:26 2011
@@ -141,7 +141,7 @@
         <bundle>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.fsresource</artifactId>
-            <version>1.0.2</version>
+            <version>1.0.3-SNAPSHOT</version>
         </bundle>
 
         <!-- Launchpad initial content -->



Mime
View raw message