sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1511620 - in /sis/branches/0.3: application/sis-console/src/main/java/org/apache/sis/console/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-util...
Date Thu, 08 Aug 2013 08:51:48 GMT
Author: desruisseaux
Date: Thu Aug  8 08:51:48 2013
New Revision: 1511620

URL: http://svn.apache.org/r1511620
Log:
Temporary hack for recognizing XML files from the filename in the command line,
and more accurate warning about features not yet implemented in SIS 0.3 release.

Modified:
    sis/branches/0.3/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
    sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
    sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
    sis/branches/0.3/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java

Modified: sis/branches/0.3/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
URL: http://svn.apache.org/viewvc/sis/branches/0.3/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java?rev=1511620&r1=1511619&r2=1511620&view=diff
==============================================================================
--- sis/branches/0.3/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
[UTF-8] (original)
+++ sis/branches/0.3/application/sis-console/src/main/java/org/apache/sis/console/MetadataSC.java
[UTF-8] Thu Aug  8 08:51:48 2013
@@ -17,6 +17,7 @@
 package org.apache.sis.console;
 
 import java.util.EnumSet;
+import java.io.File;
 import java.io.IOException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.JAXBException;
@@ -80,11 +81,17 @@ final class MetadataSC extends SubComman
             return Command.INVALID_ARGUMENT_EXIT_CODE;
         }
         final Metadata metadata;
-        final NetcdfStore store = new NetcdfStore(new StorageConnector(files.get(0)));
-        try {
-            metadata = store.getMetadata();
-        } finally {
-            store.close();
+        final String file = files.get(0);
+        if (file.endsWith(".xml")) {
+            final Object obj = XML.unmarshal(new File(file));
+            metadata = (obj instanceof Metadata) ? (Metadata) obj : null;
+        } else {
+            final NetcdfStore store = new NetcdfStore(new StorageConnector(file));
+            try {
+                metadata = store.getMetadata();
+            } finally {
+                store.close();
+            }
         }
         /*
          * Format metadata to the standard output stream.

Modified: sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java?rev=1511620&r1=1511619&r2=1511620&view=diff
==============================================================================
--- sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
[UTF-8] (original)
+++ sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java
[UTF-8] Thu Aug  8 08:51:48 2013
@@ -116,7 +116,7 @@ public class SC_VerticalCRS extends Prop
      */
     @XmlAnyElement(lax = true)
     public Object getElement() {
-        final LogRecord record = new LogRecord(Level.WARNING, "Not supported in Apache SIS
0.3.");
+        final LogRecord record = new LogRecord(Level.WARNING, "VerticalCRS is not supported
in Apache SIS 0.3.");
         record.setSourceClassName(SC_VerticalCRS.class.getName());
         record.setSourceMethodName("getElement");
         final Context context = Context.current();

Modified: sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
URL: http://svn.apache.org/viewvc/sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java?rev=1511620&r1=1511619&r2=1511620&view=diff
==============================================================================
--- sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
[UTF-8] (original)
+++ sis/branches/0.3/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ReferencingServices.java
[UTF-8] Thu Aug  8 08:51:48 2013
@@ -77,7 +77,7 @@ public abstract class ReferencingService
         if (instance == null) try {
             instance = (ReferencingServices) Class.forName("org.apache.sis.internal.referencing.ServicesForMetadata").newInstance();
         } catch (ClassNotFoundException exception) {
-            throw new UnsupportedOperationException("Not supported in Apache SIS 0.3.", exception);
+            throw new UnsupportedOperationException("Referencing services are not supported
in Apache SIS 0.3.", exception);
         } catch (Exception exception) { // (ReflectiveOperationException) on JDK7 branch.
             // Should never happen if we didn't broke our helper class.
             throw new AssertionError(exception);

Modified: sis/branches/0.3/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/0.3/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java?rev=1511620&r1=1511619&r2=1511620&view=diff
==============================================================================
--- sis/branches/0.3/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
[UTF-8] (original)
+++ sis/branches/0.3/core/sis-utility/src/main/java/org/apache/sis/internal/util/TemporalUtilities.java
[UTF-8] Thu Aug  8 08:51:48 2013
@@ -53,7 +53,7 @@ public final class TemporalUtilities ext
         if (factory != null) {
             return factory;
         }
-        throw new UnsupportedOperationException("Not supported in Apache SIS 0.3.");
+        throw new UnsupportedOperationException("TemporalFactory is not supported in Apache
SIS 0.3.");
     }
 
     /**



Mime
View raw message