oodt-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1102795&view=rev
Log:
- fix for OODT-192 PGE FilenameExtractorMetWriter

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

Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1102795&r1=1102794&r2=1102795&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Fri May 13 15:44:45 2011
@@ -4,6 +4,8 @@ Apache OODT Change Log
 Release 0.3-SNAPSHOT (in progress)
 --------------------------------------------
 
+* OODT-192 PGE FilenameExtractorMetWriter (mattmann)
+
 * OODT-156 Rewrite Workflow Monitor webapp using Apache Wicket (mattmann)
 
 * OODT-190 WorkflowCondition configuration isn't read (mattmann)

Added: oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/FilenameExtractorWriter.java
URL: http://svn.apache.org/viewvc/oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/FilenameExtractorWriter.java?rev=1102795&view=auto
==============================================================================
--- oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/FilenameExtractorWriter.java
(added)
+++ oodt/trunk/pge/src/main/java/org/apache/oodt/cas/pge/writers/FilenameExtractorWriter.java
Fri May 13 15:44:45 2011
@@ -0,0 +1,55 @@
+/**
+ * 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.FilenameTokenMetExtractor;
+import org.apache.oodt.cas.pge.writers.PcsMetFileWriter;
+
+/**
+ * 
+ * Wrap CAS-Metadata's {@link FilenameTokenMetExtractor} as a CAS-PGE
+ * {@link PcsMetFileWriter}. First arg passed in is the config file full path.
+ * 
+ * @author mattmann
+ * @version $Revision$
+ * 
+ */
+public class FilenameExtractorWriter extends PcsMetFileWriter {
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.apache.oodt.cas.pge.writers.PcsMetFileWriter#getSciPgeSpecificMetadata
+   * (java.io.File, org.apache.oodt.cas.metadata.Metadata, java.lang.Object[])
+   */
+  @Override
+  protected Metadata getSciPgeSpecificMetadata(File generatedFile,
+      Metadata workflowMet, Object... args) throws Exception {
+    String metConfFilePath = String.valueOf(args[0]);
+    FilenameTokenMetExtractor extractor = new FilenameTokenMetExtractor();
+    extractor.setConfigFile(metConfFilePath);
+    return extractor.extractMetadata(generatedFile);
+  }
+
+}



Mime
View raw message