incubator-photark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r943794 - in /incubator/photark/trunk/photark-filesystem/src: main/java/org/apache/photark/filesystem/impl/ main/java/org/apache/photark/filesystem/services/ test/java/org/apache/photark/filesystem/impl/ test/java/org/apache/photark/filesys...
Date Thu, 13 May 2010 04:20:25 GMT
Author: lresende
Date: Thu May 13 04:20:25 2010
New Revision: 943794

URL: http://svn.apache.org/viewvc?rev=943794&view=rev
Log:
PHOTARK-38 - Applying patch from Henry Saputra to tyde up package names for fileSystem implementation

Added:
    incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/
    incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
  (contents, props changed)
      - copied, changed from r943789, incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/AlbumImpl.java
    incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
  (contents, props changed)
      - copied, changed from r943789, incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/GalleryImpl.java
    incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/
    incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java
  (contents, props changed)
      - copied, changed from r943789, incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/impl/GalleryTestCase.java
Removed:
    incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/
    incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/impl/

Copied: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
(from r943789, incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/AlbumImpl.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java?p2=incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java&p1=incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/AlbumImpl.java&r1=943789&r2=943794&rev=943794&view=diff
==============================================================================
--- incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/AlbumImpl.java
(original)
+++ incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
Thu May 13 04:20:25 2010
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.photark.filesystem.impl;
+package org.apache.photark.filesystem.services;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -29,15 +29,14 @@ import org.apache.photark.services.album
 import org.oasisopen.sca.annotation.Init;
 import org.oasisopen.sca.annotation.Property;
 
-
-public class AlbumImpl implements Album {
+public class FileSystemAlbumImpl implements org.apache.photark.services.album.Album {
 	private String name;
 	private String location;
-	private String description;    
+	private String description;
 	private boolean initialized;
-	private List<String> pictures = new ArrayList<String>();
+	private java.util.List<String> pictures = new java.util.ArrayList<String>();
 
-	@Init
+	@org.oasisopen.sca.annotation.Init
 	public void init() {
 		try {
 			/*
@@ -48,9 +47,9 @@ public class AlbumImpl implements Album 
             }*/
 
 			if(location != null) {
-				File album = new File(location);
+				java.io.File album = new java.io.File(location);
 				if (album.isDirectory() && album.exists()) {
-					String[] listPictures = album.list(new ImageFilter(".jpg"));
+					String[] listPictures = album.list(new org.apache.photark.services.album.ImageFilter(".jpg"));
 					for(String image : listPictures) {
 						pictures.add(image);
 					}
@@ -66,7 +65,7 @@ public class AlbumImpl implements Album 
 		return name;
 	}
 
-	@Property
+	@org.oasisopen.sca.annotation.Property
 	public void setName(String name) {
 		this.name = name;
 		this.location = null;
@@ -76,7 +75,7 @@ public class AlbumImpl implements Album 
 		return location;
 	}
 
-	@Property
+	@org.oasisopen.sca.annotation.Property
 	public void setLocation(String location) {
 		this.location = location;
 	}
@@ -90,11 +89,11 @@ public class AlbumImpl implements Album 
 		return pictureArray;
 	}
 
-	public void addPicture(Image picture){
+	public void addPicture(org.apache.photark.Image picture){
 		throw new UnsupportedOperationException("Not implemented");
 	}
 
-	public void deletePicture(Image picture){
+	public void deletePicture(org.apache.photark.Image picture){
 		throw new UnsupportedOperationException("Not implemented");
 	}
 
@@ -109,4 +108,5 @@ public class AlbumImpl implements Album 
 	public void setDescription(String description) {
 		this.description=description;
 	}
-}
\ No newline at end of file
+}
+

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemAlbumImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
(from r943789, incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/GalleryImpl.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java?p2=incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java&p1=incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/GalleryImpl.java&r1=943789&r2=943794&rev=943794&view=diff
==============================================================================
--- incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/impl/GalleryImpl.java
(original)
+++ incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
Thu May 13 04:20:25 2010
@@ -6,18 +6,18 @@
  * 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.    
+ * under the License.
  */
 
-package org.apache.photark.filesystem.impl;
+package org.apache.photark.filesystem.services;
 
 import java.io.File;
 import java.net.URL;
@@ -28,45 +28,46 @@ import org.apache.photark.services.galle
 import org.apache.photark.services.gallery.Gallery;
 import org.oasisopen.sca.annotation.Init;
 
-public class GalleryImpl extends BaseGalleryImpl implements Gallery {
-    private static final Logger logger = Logger.getLogger(GalleryImpl.class.getName());
+public class FileSystemGalleryImpl extends BaseGalleryImpl implements Gallery {
+    private static final java.util.logging.Logger logger =
+        java.util.logging.Logger.getLogger(FileSystemGalleryImpl.class.getName());
 
-    public GalleryImpl(){
+    public FileSystemGalleryImpl() {
 
     }
 
-    public GalleryImpl(String name){
+    public FileSystemGalleryImpl(String name) {
         super(name);
     }
 
 
-    @Init
+    @org.oasisopen.sca.annotation.Init
     public void init() {
         logger.info("Initializing fileSystem Gallery");
         try {
-            URL galleryURL = this.getClass().getClassLoader().getResource(name);
+            java.net.URL galleryURL = this.getClass().getClassLoader().getResource(name);
             if(galleryURL == null) {
                 // Accomodate for J2EE classpath that starts in WEB-INF\classes
                 galleryURL = this.getClass().getClassLoader().getResource("../../" + name);
             }
             if(galleryURL == null) {
-                // Workaroud for Google apps Engine 
+                // Workaroud for Google apps Engine
                 String galleryDir = System.getProperty("user.dir") + "/"  + name;
-                galleryURL = new URL("file://" + galleryDir);
+                galleryURL = new java.net.URL("file://" + galleryDir);
             }
 
             if(galleryURL != null) {
-                File album = new File(galleryURL.toURI());
+                java.io.File album = new java.io.File(galleryURL.toURI());
                 if (album.isDirectory() && album.exists()) {
-                    File[] albums = album.listFiles();
-                    for(File albumFile : albums) {
+                    java.io.File[] albums = album.listFiles();
+                    for(java.io.File albumFile : albums) {
                         if(! albumFile.getName().startsWith(".")) {
                             if(albumFile.isDirectory() && albumFile.exists()) {
-                                Album newAlbum = new org.apache.photark.filesystem.impl.AlbumImpl();
+                                org.apache.photark.services.album.Album newAlbum = new FileSystemAlbumImpl();
                                 newAlbum.setName(albumFile.getName());
                                 newAlbum.setLocation(albumFile.getPath());
                                 this.albums.add(newAlbum);
-                            }                                
+                            }
                         }
                     }
                 }
@@ -78,11 +79,11 @@ public class GalleryImpl extends BaseGal
         initialized = true;
     }
 
-    public void addAlbum(String albumName){
+    public void addAlbum(String albumName) {
 
     }
 
 	public void deleteAlbum(String albumName) {
-		
+
 	}
 }
\ No newline at end of file

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/photark/trunk/photark-filesystem/src/main/java/org/apache/photark/filesystem/services/FileSystemGalleryImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java
(from r943789, incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/impl/GalleryTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java?p2=incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java&p1=incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/impl/GalleryTestCase.java&r1=943789&r2=943794&rev=943794&view=diff
==============================================================================
--- incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/impl/GalleryTestCase.java
(original)
+++ incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java
Thu May 13 04:20:25 2010
@@ -6,39 +6,39 @@
  * 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.    
+ * under the License.
  */
 
-package org.apache.photark.filesystem.impl;
+package org.apache.photark.filesystem.services;
 
 import junit.framework.Assert;
 
-import org.apache.photark.filesystem.impl.GalleryImpl;
+import org.apache.photark.filesystem.services.FileSystemGalleryImpl;
 import org.apache.photark.services.album.Album;
 import org.apache.photark.services.gallery.Gallery;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class GalleryTestCase {
+public class FileSystemGalleryTestCase {
     private static Gallery gallery;
-    
+
     @BeforeClass
     public static void BeforeClass() {
-        gallery = new GalleryImpl("gallery-home");
+        gallery = new FileSystemGalleryImpl("gallery-home");
     }
-    
+
     @Test
     public void testDiscoverAlbums() {
         Album[] albums = gallery.getAlbums();
-        
+
         Assert.assertEquals(2, albums.length);
         Assert.assertTrue(albums[0].getName().startsWith("album-"));
         Assert.assertTrue(albums[1].getName().startsWith("album-"));

Propchange: incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/photark/trunk/photark-filesystem/src/test/java/org/apache/photark/filesystem/services/FileSystemGalleryTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message