geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r703960 - in /geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main: java/org/apache/geronimo/gshell/xstore/XStoreImpl.java java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java resources/META-INF/spring/components.xml
Date Mon, 13 Oct 2008 08:14:44 GMT
Author: jdillon
Date: Mon Oct 13 01:14:44 2008
New Revision: 703960

URL: http://svn.apache.org/viewvc?rev=703960&view=rev
Log:
Fix up a few issues to get the xstore working

Modified:
    geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreImpl.java
    geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java
    geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/resources/META-INF/spring/components.xml

Modified: geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreImpl.java?rev=703960&r1=703959&r2=703960&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreImpl.java
Mon Oct 13 01:14:44 2008
@@ -59,14 +59,17 @@
         if (fileSystem == null) {
             try {
                 assert fileSystemAccess != null;
-                FileObject file = fileSystemAccess.getManager().createVirtualFileSystem(getRootUri());
-                log.debug("Root file: {}", file);
+                String uri = getRootUri();
 
+                FileObject root = fileSystemAccess.resolveFile(null, uri);
+                log.debug("Root: {}", uri);
+
+                FileObject file = fileSystemAccess.getManager().createVirtualFileSystem(root);
                 fileSystem = file.getFileSystem();
                 log.debug("File system: {}", fileSystem);
             }
             catch (FileSystemException e) {
-                throw new XStoreException("Failed to create file-sysytem", e);
+                throw new XStoreException(e);
             }
         }
 

Modified: geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java?rev=703960&r1=703959&r2=703960&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/java/org/apache/geronimo/gshell/xstore/XStoreRecordImpl.java
Mon Oct 13 01:14:44 2008
@@ -55,6 +55,10 @@
         return file.getName().getPath();
     }
 
+    public String toString() {
+        return getPath();    
+    }
+
     public boolean exists() {
         try {
             return file.exists();
@@ -93,6 +97,12 @@
 
         try {
             Marshaller<T> marshaller = new MarshallerSupport<T>(type);
+            
+            FileObject parent = file.getParent();
+            if (parent != null && !parent.exists()) {
+                parent.createFolder();
+            }
+
             input = new BufferedInputStream(file.getContent().getInputStream());
             T value = marshaller.unmarshal(input);
             log.debug("Value: {}", value);

Modified: geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/resources/META-INF/spring/components.xml?rev=703960&r1=703959&r2=703960&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-xstore/src/main/resources/META-INF/spring/components.xml
Mon Oct 13 01:14:44 2008
@@ -24,6 +24,8 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
     <bean id="xstore" class="org.apache.geronimo.gshell.xstore.XStoreImpl">
         <property name="rootUri"  value="file:${gshell.home}/var/xstore"/>
     </bean>



Mime
View raw message