Package org.apache.airavata.gfac.gram.external

Examples of org.apache.airavata.gfac.gram.external.GridFtp.uploadFile()


            //if user give a url just to refer an endpoint, not a web resource we are not doing any transfer
            if (fileName != null && !"".equals(fileName)) {
                destURI = GramProviderUtils.createGsiftpURI(endpoint, destLocalPath);
                if (paramValue.startsWith("gsiftp")) {
                  // no need to do if it is unicore, as unicore will download this on user's behalf to the job space dir
                  if(isInputNonLocal) ftp.uploadFile(gridftpURL, destURI, gssCred);
                  else return paramValue;
                } else if (paramValue.startsWith("file")) {
                    String localFile = paramValue.substring(paramValue.indexOf(":") + 1, paramValue.length());
                    FileInputStream fis = null;
                    try {
View Full Code Here


                } else if (paramValue.startsWith("file")) {
                    String localFile = paramValue.substring(paramValue.indexOf(":") + 1, paramValue.length());
                    FileInputStream fis = null;
                    try {
                      fis = new FileInputStream(localFile);
                      ftp.uploadFile(destURI, gssCred, fis);
                    } catch (IOException e) {
                        throw new GFacException("Unable to create file : " + localFile ,e);
                    } finally {
                        if (fis != null) {
                            fis.close();
View Full Code Here

                  // no need to do if it is unicore
                  if(isInputNonLocal) {
                    InputStream is = null;
                    try {
                      is = gridftpURL.toURL().openStream();
                      ftp.uploadFile(destURI, gssCred, (is));
                    }finally {
                      is.close();
                    }
                  } else {
                    // don't return destUri
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.