Examples of FileDataSource


Examples of com.google.code.javax.activation.FileDataSource

     * @exception  IOException  errors related to accessing the file
     * @exception  MessagingException  message related errors
     * @since    JavaMail 1.4
     */
    public void attachFile(File file) throws IOException, MessagingException {
      FileDataSource fds = new FileDataSource(file);    
        this.setDataHandler(new DataHandler(fds));
        this.setFileName(fds.getName());
    }
View Full Code Here

Examples of eu.stratosphere.api.java.record.operators.FileDataSource

  //                      /
  //    Sc3(id,y) --------
  @Override
  protected Plan getTestJob() {
    // Sc1 generates M parameters a,b,c for second degree polynomials P(x) = ax^2 + bx + c identified by id
    FileDataSource sc1 = new FileDataSource(new CsvInputFormat(), sc1Path);
    CsvInputFormat.configureRecordFormat(sc1).fieldDelimiter(' ').field(StringValue.class, 0).field(IntValue.class, 1)
        .field(IntValue.class, 2).field(IntValue.class, 3);

    // Sc2 generates N x values to be evaluated with the polynomial identified by id
    FileDataSource sc2 = new FileDataSource(new CsvInputFormat(), sc2Path);
    CsvInputFormat.configureRecordFormat(sc2).fieldDelimiter(' ').field(StringValue.class, 0).field(IntValue.class, 1);

    // Sc3 generates N y values to be evaluated with the polynomial identified by id
    FileDataSource sc3 = new FileDataSource(new CsvInputFormat(), sc3Path);
    CsvInputFormat.configureRecordFormat(sc3).fieldDelimiter(' ').field(StringValue.class, 0).field(IntValue.class, 1);

    // Jn1 matches x and y values on id and emits (id, x, y) triples
    JoinOperator jn1 = JoinOperator.builder(Jn1.class, StringValue.class, 0, 0).input1(sc2).input2(sc3).build();
View Full Code Here

Examples of javax.activation.FileDataSource

        while (it.hasNext()) {
          WGARemoteServer current = it.next();
          monitor.setTaskName("Exporting plugin '" + _model.getPluginUniqueName() + "' to server '" + current.getName() + "'.");
          _model.exportPlugin(tmpFile, _serverPage.getBuild(), false, false);
          List<DataSource> dataSources = new ArrayList<DataSource>();
          dataSources.add(new FileDataSource(tmpFile));
          try {
            current.getServices().installPlugins(current.getSession(), dataSources);
            monitor.worked(1);
          } catch (WGAServiceException e) {           
            throw new InvocationTargetException(e, "Plugin export to server '" + current.getName() + " (" + current.getUrl() + ") failed.");
View Full Code Here

Examples of javax.activation.FileDataSource

                                IPath remotePathObj = resource.getLocation();
                                int count = remotePathObj.matchingFirstSegments(_runtime.getDesignRoot().getLocation());
                                remotePathObj = remotePathObj.removeFirstSegments(count);
                                String remotePath = remotePathObj.toString();
                                if (resource.getType() == IResource.FILE) {
                                    DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
                                    try {
                                        _remoteServer.getServices().updateFSDesignResource(_remoteServer.getSession(), remotePath, content, resource.getLocalTimeStamp());
                                    }
                                    catch (WGAServiceException e) {
                                        throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design file failed.", e));
View Full Code Here

Examples of javax.activation.FileDataSource

        bcc.add(address);
        return this;
    }

    public MailMessage addAttachment(File attachment) {
        FileDataSource ds = new FileDataSource(attachment);
        return addAttachment(ds);
    }
View Full Code Here

Examples of javax.activation.FileDataSource

                  monitor.setTaskName("adding '" + remotePath + "'.");
                } else {
                  monitor.setTaskName("updating '" + remotePath + "'.");
                }
                if (resource.getType() == IResource.FILE) {
                  DataSource content = new FileDataSource(((IFile)resource).getLocation().toFile());
                  wgaSyncInfo.getServer().getServices().updateFSDesignResource(session, remotePath, content, resource.getLocalTimeStamp());
                  committedResources.add(resource);
                } else if (resource.getType() == IResource.FOLDER) {
                  wgaSyncInfo.getServer().getServices().mkFSDesignDir(session, remotePath);
                  committedResources.add(resource);
View Full Code Here

Examples of javax.activation.FileDataSource

        Iterator attachmentIterator = attachments.iterator();
        while (attachmentIterator.hasNext()) {
          messageBodyPart = new MimeBodyPart();
          CvFileVO thisAttachment = (CvFileVO) attachmentIterator.next();
          String path = thisAttachment.getPhysicalFolderVO().getFullPath(null, true) + thisAttachment.getName();
          DataSource source = new FileDataSource(path);
          messageBodyPart.setDataHandler(new DataHandler(source));
          messageBodyPart.setFileName(thisAttachment.getTitle());
          multipart.addBodyPart(messageBodyPart);
        }
      }
View Full Code Here

Examples of javax.activation.FileDataSource

        Iterator attachmentIterator = attachments.iterator();
        while (attachmentIterator.hasNext()) {
          messageBodyPart = new MimeBodyPart();
          CvFileVO thisAttachment = (CvFileVO) attachmentIterator.next();
          String path = thisAttachment.getPhysicalFolderVO().getFullPath(null, true) + thisAttachment.getName();
          DataSource source = new FileDataSource(path);
          messageBodyPart.setDataHandler(new DataHandler(source));
          messageBodyPart.setFileName(thisAttachment.getTitle());
          multipart.addBodyPart(messageBodyPart);
        }
      }
View Full Code Here

Examples of javax.activation.FileDataSource

            //����htmlҳ���ϵ�ͼƬ�������£�
            private void processHtmlImage(String mailContent) throws MessagingException {
                for (int i = 0; i < arrayList1.size(); i++) {
                    messageBodyPart = new MimeBodyPart();
                    DataSource source = new FileDataSource((String) arrayList1.get(i));
                    messageBodyPart.setDataHandler(new DataHandler(source));
                    String contentId = "<" + (String) arrayList2.get(i) + ">";
                    messageBodyPart.setHeader("Content-ID", contentId);
                    messageBodyPart.setFileName((String) arrayList1.get(i));
                    multipart.addBodyPart(messageBodyPart);
View Full Code Here

Examples of javax.activation.FileDataSource

     * @param attachmentName
     * @throws MessagingException
     */
    public void setAttachments(String attachmentName) throws MessagingException {
        messageBodyPart = new MimeBodyPart();
        DataSource source = new FileDataSource(attachmentName);
        messageBodyPart.setDataHandler(new DataHandler(source));
        int index = attachmentName.lastIndexOf(File.separator);
        String attachmentRealName = attachmentName.substring(index + 1);
        messageBodyPart.setFileName(attachmentRealName);
        multipart.addBodyPart(messageBodyPart);
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.