[Swift-commit] r5798 - trunk/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sat May 26 18:15:16 CDT 2012


Author: hategan
Date: 2012-05-26 18:15:16 -0500 (Sat, 26 May 2012)
New Revision: 5798

Added:
   trunk/src/org/griphyn/vdl/karajan/lib/GetURLPrefix.java
Log:
added class to get URL prefix for wrapper staging

Added: trunk/src/org/griphyn/vdl/karajan/lib/GetURLPrefix.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/GetURLPrefix.java	                        (rev 0)
+++ trunk/src/org/griphyn/vdl/karajan/lib/GetURLPrefix.java	2012-05-26 23:15:16 UTC (rev 5798)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012 University of Chicago
+ * 
+ * Licensed 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.
+ */
+
+
+/*
+ * Created on Jul 18, 2010
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.globus.cog.karajan.arguments.Arg;
+import org.globus.cog.karajan.stack.VariableStack;
+import org.globus.cog.karajan.workflow.ExecutionException;
+import org.globus.cog.karajan.workflow.nodes.AbstractSequentialWithArguments;
+import org.griphyn.vdl.karajan.functions.ConfigProperty;
+
+public class GetURLPrefix extends AbstractSequentialWithArguments {
+    
+    @Override
+    protected void post(VariableStack stack) throws ExecutionException {
+        
+        String localServerBase = ConfigProperty.getProperty("wrapper.staging.local.server", stack);
+        
+        String cwd = stack.getExecutionContext().getCwd();
+        if (cwd.endsWith("/.")) {
+            cwd = cwd.substring(0, cwd.length() - 2);
+        }
+        
+        ret(stack, localServerBase + cwd);
+        
+        super.post(stack);
+    }
+}




More information about the Swift-commit mailing list