oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1102797 - in /oodt/trunk: CHANGES.txt pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java
Date Fri, 13 May 2011 15:45:44 GMT
Author: mattmann
Date: Fri May 13 15:45:43 2011
New Revision: 1102797

URL: http://svn.apache.org/viewvc?rev=1102797&view=rev
Log:
- fix for OODT-193 PGE ExternMetExtractor MetWriter

Added:
    oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java
Modified:
    oodt/trunk/CHANGES.txt

Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1102797&r1=1102796&r2=1102797&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Fri May 13 15:45:43 2011
@@ -4,6 +4,8 @@ Apache OODT Change Log
 Release 0.3-SNAPSHOT (in progress)
 --------------------------------------------
 
+* OODT-193 PGE ExternMetExtractor MetWriter (bfoster, mattmann)
+
 * OODT-192 PGE FilenameExtractorMetWriter (mattmann)
 
 * OODT-156 Rewrite Workflow Monitor webapp using Apache Wicket (mattmann)

Added: oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java
URL: http://svn.apache.org/viewvc/oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java?rev=1102797&view=auto
==============================================================================
--- oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java
(added)
+++ oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/ExternExtractorMetWriter.java
Fri May 13 15:45:43 2011
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file 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.
+ */
+
+package org.apache.oodt.cas.pge.writers;
+
+//JDK imports
+import java.io.File;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.metadata.extractors.ExternConfigReader;
+import org.apache.oodt.cas.metadata.extractors.ExternMetExtractor;
+import org.apache.oodt.cas.pge.writers.PcsMetFileWriter;
+
+/**
+ * 
+ * Wraps the OODT CAS {@link ExternMetExtractor} and exposes it as a CAS-PGE
+ * {@link PcsMetFileWriter}.
+ * 
+ */
+public class ExternExtractorMetWriter extends PcsMetFileWriter {
+
+  @Override
+  protected Metadata getSciPgeSpecificMetadata(File sciPgeConfigFilePath,
+      Metadata inputMetadata, Object... customArgs) throws Exception {
+    ExternMetExtractor extractor = new ExternMetExtractor();
+    extractor.setConfigFile(new ExternConfigReader().parseConfigFile(new File(
+        (String) customArgs[0])));
+    Metadata m = new Metadata();
+    m.addMetadata(extractor.extractMetadata(sciPgeConfigFilePath)
+        .getHashtable(), true);
+    return m;
+  }
+
+}



Mime
View raw message