You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2022/06/17 18:06:32 UTC

[airavata] branch revert-298-output-staging-wildcard-fix created (now 92cb621cd1)

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a change to branch revert-298-output-staging-wildcard-fix
in repository https://gitbox.apache.org/repos/asf/airavata.git


      at 92cb621cd1 Revert "Handling special characters in output staging"

This branch includes the following new commits:

     new 92cb621cd1 Revert "Handling special characters in output staging"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[airavata] 01/01: Revert "Handling special characters in output staging"

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch revert-298-output-staging-wildcard-fix
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 92cb621cd189d908a6939470830f6a9c77a718c3
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri Jun 17 14:06:29 2022 -0400

    Revert "Handling special characters in output staging"
    
    This reverts commit fbdbff47ba91067d3dda711f78972252246b1c36.
---
 .../helix/impl/task/staging/DataStagingTask.java        | 17 +----------------
 .../helix/impl/task/staging/OutputDataStagingTask.java  | 11 ++++-------
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/DataStagingTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/DataStagingTask.java
index d220ca0c57..89f2dfff84 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/DataStagingTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/DataStagingTask.java
@@ -151,27 +151,12 @@ public abstract class DataStagingTask extends AiravataTask {
         return filePath;
     }
 
-    protected String escapeSpecialCharacters(String inputString){
-        final String[] metaCharacters = {"\\","^","$","{","}","[","]","(",")","?","&","%"};
-
-        for (String metaCharacter : metaCharacters) {
-            if (inputString.contains(metaCharacter)) {
-                inputString = inputString.replace(metaCharacter, "\\" + metaCharacter);
-            }
-        }
-        return inputString;
-    }
-
     public void naiveTransfer(AgentAdaptor srcAdaptor, String sourceFile, AgentAdaptor destAdaptor, String destFile,
                               String tempFile) throws TaskOnFailException {
-
-        sourceFile = escapeSpecialCharacters(sourceFile);
-        destFile = escapeSpecialCharacters(destFile);
-
         logger.info("Using naive transfer to transfer " + sourceFile + " to " + destFile);
         try {
             try {
-                logger.info("Downloading file " + sourceFile + " to local temp file " + tempFile);
+                logger.info("Downloading file " + sourceFile + " to loacl temp file " + tempFile);
                 srcAdaptor.downloadFile(sourceFile, tempFile);
             } catch (AgentException e) {
                 throw new TaskOnFailException("Failed downloading file " + sourceFile + " to the local path " +
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
index ba06618f98..e9ec4d3d68 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
@@ -171,11 +171,9 @@ public class OutputDataStagingTask extends DataStagingTask {
                 }
                 if (!destinationURIs.isEmpty()) {
                     if (processOutput.getType() == DataType.URI) {
-                        saveExperimentOutput(processOutput.getName(), escapeSpecialCharacters(destinationURIs.get(0).toString()));
+                        saveExperimentOutput(processOutput.getName(), destinationURIs.get(0).toString());
                     } else if (processOutput.getType() == DataType.URI_COLLECTION) {
-                        saveExperimentOutputCollection(processOutput.getName(), destinationURIs.stream()
-                                .map(URI::toString)
-                                .map(this::escapeSpecialCharacters).collect(Collectors.toList()));
+                        saveExperimentOutputCollection(processOutput.getName(), destinationURIs.stream().map(URI::toString).collect(Collectors.toList()));
                     }
                 }
                 return onSuccess("Output data staging task " + getTaskId() + " successfully completed");
@@ -183,10 +181,9 @@ public class OutputDataStagingTask extends DataStagingTask {
             } else {
                 // Uploading output file to the storage resource
                 assert processOutput != null;
-                boolean transferred = transferFileToStorage(sourceURI.getPath(), destinationURI.getPath(),
-                        sourceFileName, adaptor, storageResourceAdaptor);
+                boolean transferred = transferFileToStorage(sourceURI.getPath(), destinationURI.getPath(), sourceFileName, adaptor, storageResourceAdaptor);
                 if (transferred) {
-                    saveExperimentOutput(processOutput.getName(), escapeSpecialCharacters(destinationURI.toString()));
+                    saveExperimentOutput(processOutput.getName(), destinationURI.toString());
                 } else {
                     logger.warn("File " + sourceFileName + " did not transfer");
                 }