Search in sources :

Example 6 with GFacProviderException

use of org.apache.airavata.gfac.core.provider.GFacProviderException in project airavata by apache.

the class DataTransferrer method uploadLocalFiles.

public void uploadLocalFiles() throws GFacProviderException {
    List<String> inFilePrms = extractInFileParams();
    for (String uri : inFilePrms) {
        String fileName = new File(uri).getName();
        if (uri.startsWith("file")) {
            try {
                String uriWithoutProtocol = uri.substring(uri.lastIndexOf("://") + 1, uri.length());
                FileUploader fileUploader = new FileUploader(uriWithoutProtocol, fileName, Mode.overwrite);
                fileUploader.perform(storageClient);
            } catch (FileNotFoundException e3) {
                throw new GFacProviderException("Error while staging-in, local file " + fileName + " not found", e3);
            } catch (Exception e) {
                throw new GFacProviderException("Cannot upload files", e);
            }
        }
    }
}
Also used : FileNotFoundException(java.io.FileNotFoundException) GFacProviderException(org.apache.airavata.gfac.core.provider.GFacProviderException) File(java.io.File) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) GFacProviderException(org.apache.airavata.gfac.core.provider.GFacProviderException)

Aggregations

GFacProviderException (org.apache.airavata.gfac.core.provider.GFacProviderException)6 File (java.io.File)3 FileNotFoundException (java.io.FileNotFoundException)3 IOException (java.io.IOException)3 X509Credential (eu.emi.security.authn.x509.X509Credential)1 DefaultClientConfiguration (eu.unicore.util.httpclient.DefaultClientConfiguration)1 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)1 ActivityInfo (org.apache.airavata.gfac.bes.utils.ActivityInfo)1 GFacException (org.apache.airavata.gfac.core.GFacException)1 GFacHandlerException (org.apache.airavata.gfac.core.handler.GFacHandlerException)1 ApplicationDeploymentDescription (org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)1 OutputDataObjectType (org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType)1 ComputationalResourceScheduling (org.apache.airavata.model.experiment.ComputationalResourceScheduling)1 TaskDetails (org.apache.airavata.model.experiment.TaskDetails)1