Examples of uploadFile()

  • org.modeshape.jcr.api.JcrTools.uploadFile()
    Upload the content in the supplied stream into the repository at the defined path, using the given session. This method will create a 'nt:file' node at the supplied path, and any non-existant ancestors with nodes of type 'nt:folder'. As defined by the JCR specification, the binary content (and other properties) will be placed on a child of the 'nt:file' node named 'jcr:content' with a node type of 'nt:resource'.

    This method always closes the supplied stream.

    @param session the JCR session @param path the path to the file @param stream the stream containing the content to be uploaded @return the newly created 'nt:file' node @throws RepositoryException if there is a problem uploading the file @throws IOException if there is a problem using the stream @throws IllegalArgumentException is any of the parameters are null
  • org.serviceconnector.api.cln.SCFileService.uploadFile()
    Upload file with default operation timeout. @param remoteFileName the remote file name to store the file @param inStream stream to upload @throws SCServiceException create file session to SC failed
    upload file to Server failed
    error message received from SC
  • org.uengine.util.ftp.Uploader.uploadFile()
  • sendspaceapi.Upload.Anonymous.AnonymousUpload.uploadFile()

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

                    destURI = GfacUtils.createGsiftpURI(endpoint, s);
                    if (paramValue.startsWith("gsiftp")) {
                        ftp.uploadFile(gridftpURL, destURI, gssCred);
                    } else if (paramValue.startsWith("file")) {
                        String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
                        ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
                    }else if (paramValue.startsWith("http")) {
                        ftp.uploadFile(destURI,
                                gssCred, (gridftpURL.toURL().openStream()));
                    }else {
                        //todo throw exception telling unsupported protocol
    View Full Code Here

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

                        ftp.uploadFile(gridftpURL, destURI, gssCred);
                    } else if (paramValue.startsWith("file")) {
                        String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
                        ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
                    }else if (paramValue.startsWith("http")) {
                        ftp.uploadFile(destURI,
                                gssCred, (gridftpURL.toURL().openStream()));
                    }else {
                        //todo throw exception telling unsupported protocol
                        return paramValue;
                    }
    View Full Code Here

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

                String s = inputURI.getPath() + File.separator + fileName;
                //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 = GfacUtils.createGsiftpURI(endpoint, s);
                    if (paramValue.startsWith("gsiftp")) {
                        ftp.uploadFile(gridftpURL, destURI, gssCred);
                    } else if (paramValue.startsWith("file")) {
                        String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
                        ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
                    }else if (paramValue.startsWith("http")) {
                        ftp.uploadFile(destURI,
    View Full Code Here

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

                    destURI = GfacUtils.createGsiftpURI(endpoint, s);
                    if (paramValue.startsWith("gsiftp")) {
                        ftp.uploadFile(gridftpURL, destURI, gssCred);
                    } else if (paramValue.startsWith("file")) {
                        String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
                        ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
                    }else if (paramValue.startsWith("http")) {
                        ftp.uploadFile(destURI,
                                gssCred, (gridftpURL.toURL().openStream()));
                    }else {
                        //todo throw exception telling unsupported protocol
    View Full Code Here

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

                        ftp.uploadFile(gridftpURL, destURI, gssCred);
                    } else if (paramValue.startsWith("file")) {
                        String localFile = paramValue.substring(paramValue.indexOf(":")+1, paramValue.length());
                        ftp.uploadFile(destURI, gssCred, new FileInputStream(localFile));
                    }else if (paramValue.startsWith("http")) {
                        ftp.uploadFile(destURI,
                                gssCred, (gridftpURL.toURL().openStream()));
                    }else {
                        //todo throw exception telling unsupported protocol
                        return paramValue;
                    }
    View Full Code Here

    Examples of org.apache.airavata.gfac.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 = GFacUtils.createGsiftpURI(endpoint, s);
                    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

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

                    } 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);
                        }finally {
                          fis.close();
                        }
                    } else if (paramValue.startsWith("http")) {
                      // no need to do if it is unicore
    View Full Code Here

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

                      // 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

    Examples of org.apache.airavata.gfac.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 = GFacUtils.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

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

                    } 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
    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.