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);
}
}
}
}
Aggregations