Examples of FileTransfer


Examples of com.gwtmobile.phonegap.client.FileMgr.FileTransfer

      Camera.getPicture(new Camera.Callback() {
     
      @Override
      public void onSuccess(String imageData) {
        String serverUrl = "http://gwtmobile-services.appspot.com/filetransfer";
          FileTransfer ft = FileMgr.newFileTransfer();
          final String lb = "<br/>";
          Notification.activityStart("Uploading", "Hang in there...");
          ft.upload(imageData, serverUrl, new FileTransferCallback() {
          @Override
          public void onSuccess(FileTransferResult result) {
            Notification.activityStop();
            text.setHTML("response code: " + result.getResponseCode() + lb +
                "bytes sent: " + result.getBytesSent() + lb +
View Full Code Here

Examples of com.gwtmobile.phonegap.client.FileMgr.FileTransfer

      Camera.getPicture(new Camera.Callback() {
     
      @Override
      public void onSuccess(String imageData) {
        String serverUrl = "http://gwtmobile-services.appspot.com/filetransfer";
          FileTransfer ft = FileMgr.newFileTransfer();
          final String lb = "<br/>";
          Notification.activityStart("Uploading", "Hang in there...");
          ft.upload(imageData, serverUrl, new FileTransferCallback() {
          @Override
          public void onSuccess(FileTransferResult result) {
            Notification.activityStop();
            text.setHTML("response code: " + result.getResponseCode() + lb +
                "bytes sent: " + result.getBytesSent() + lb +
View Full Code Here

Examples of com.sun.faban.common.FileTransfer

    /**
     * Transfers the tool output back to the master.
     */
    protected void xferLog() {
        try {
            FileTransfer transfer = tool.fetchOutput(Command.STDOUT, outfile);
            logger.finer("Transferring log from " + logfile + " to " + outfile);
            if(transfer != null) {
                // Use FileAgent on master machine to copy log
                String s = Config.FILE_AGENT;
                FileAgent fa = (FileAgent)CmdAgentImpl.getRegistry().getService(s);
                if (fa.push(transfer) != transfer.getSize())
                    logger.log(Level.SEVERE, "Invalid transfer size");
            }
        } catch (IOException e) {
            logger.log(Level.SEVERE, "Error transferring " + logfile, e);
        }
View Full Code Here

Examples of com.sun.faban.common.FileTransfer

            logger.log(Level.SEVERE,
                    "Transfer file " + srcFile + " not found.");
            return;
        }
        try {
            FileTransfer transfer = new FileTransfer(srcFile, destFile);
            logger.finer("Transferring log from " + srcFile + " to " + destFile);
            // Use FileAgent on master machine to copy log
            String s = Config.FILE_AGENT;
            FileAgent fa = (FileAgent)CmdAgentImpl.getRegistry().getService(s);
            if (fa.push(transfer) != transfer.getSize())
                logger.log(Level.SEVERE, "Invalid transfer size");

        } catch (IOException e) {
            logger.log(Level.SEVERE, "Error transferring " + srcFile, e);
        }
View Full Code Here

Examples of com.sun.faban.common.FileTransfer

                    String outFile;
                    if ("raw".equals(key) || "xan".equals(key))
                        outFile = outDir + toolName + ext + host;
                    else
                        outFile = outDir + toolName + '-' + key + ext + host;
                    transfer[idx++] = new FileTransfer(path, outFile);
                }
            } else {
                transfer = new FileTransfer[1];
                logfile = tc.getOutputFile();
                logger.finer("single file transfer. logfile is " + logfile);
                if (!new File(logfile).exists()) {
                    logger.warning(toolName + ": Transfer file " + logfile +
                            " not found.");
                    return;
                }
                transfer[0] = new FileTransfer(logfile, outfile);
            }

            String s = Config.FILE_AGENT;
            FileAgent fa = (FileAgent) CmdAgentImpl.getRegistry().getService(s);
            for (FileTransfer t : transfer) {
View Full Code Here

Examples of com.sun.faban.common.FileTransfer

            throws IOException {
        // Copying happens in FileTransfer.writeObject and
        // FileTransfer.readObject. This is the most memory-efficient way
        // to transfer large files over RMI.
        srcFile = Utilities.convertPath(srcFile);
        FileTransfer t = new FileTransfer(srcFile, destFile);
        logger.fine("Transferring " + t.getSource() + "->" + t.getDest() +
                    " size " + t.getTransferSize() + " bytes.");
        return t;
    }
View Full Code Here

Examples of com.sun.faban.common.FileTransfer

            logger.log(Level.SEVERE,
                    "Transfer file " + logfile + " not found.");
            return;
        }
        try {
            FileTransfer transfer = new FileTransfer(logfile, outfile);
            logger.finer("Transferring log from " + logfile + " to " + outfile);
            // Use FileAgent on master machine to copy log
            String s = Config.FILE_AGENT;
            FileAgent fa = (FileAgent)CmdAgentImpl.getRegistry().getService(s);
            if (fa.push(transfer) != transfer.getSize())
                logger.log(Level.SEVERE, "Invalid transfer size");

        } catch (IOException e) {
            logger.log(Level.SEVERE, "Error transferring " + logfile, e);
        }
View Full Code Here

Examples of org.directwebremoting.io.FileTransfer

    }

    @Override
    @RemoteMethod
    public FileTransfer printGrid(String docType, GridDTO gridData) throws Exception {
        return new FileTransfer("grid." + ("PDF".equals(docType) ? "pdf" : "xls"), "application/" + docType.toLowerCase(), FileCopyUtils.copyToByteArray(reportEngine.generateGridReport(docType, gridData)));
    }
View Full Code Here

Examples of org.directwebremoting.io.FileTransfer

        File upload = new File("web/images/i18n/globe.gif");
        FileInputStream stream = new FileInputStream(upload);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        FileCopyUtils.copy(stream, out);
        ByteArrayInputStream bytes = new ByteArrayInputStream(out.toByteArray());
        transfer = new FileTransfer("globe.gif", "image/gif", bytes);
        factory = Persistence.createEntityManagerFactory("MODEL");
        entityManager = factory.createEntityManager();
        entityManager.getTransaction().begin();
    }
View Full Code Here

Examples of org.directwebremoting.io.FileTransfer

                }

                if (formField.isFile())
                {
                    InputStreamFactory inFactory = new SimpleInputStreamFactory(formField.getInputStream());
                    value = new FileTransfer(formField.getName(), formField.getMimeType(), formField.getFileSize(), inFactory);
                }
                else
                {
                    value = formField.getString();
                }
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.