Package com.eviware.soapui.impl.wsdl.support

Examples of com.eviware.soapui.impl.wsdl.support.RequestFileAttachment


  private void initAttachments()
  {
    for( AttachmentConfig ac : getConfig().getAttachmentList() )
    {
      RequestFileAttachment attachment = new RequestFileAttachment( ac, this );
      attachments.add( attachment );
    }
  }
View Full Code Here


    return attachments;
  }

  public Attachment attachBinaryData( byte[] data, String contentType )
  {
    RequestFileAttachment fileAttachment;
    try
    {
      File temp = File.createTempFile( "binaryContent", ".tmp" );

      OutputStream out = new FileOutputStream( temp );
      out.write( data );
      out.close();
      fileAttachment = new RequestFileAttachment( temp, false, this );
      fileAttachment.setContentType( contentType );
      attachments.add( fileAttachment );
      notifyPropertyChanged( ATTACHMENTS_PROPERTY, null, fileAttachment );
      return fileAttachment;
    }
    catch( IOException e )
View Full Code Here

   * boolean)
   */

  public Attachment attachFile( File file, boolean cache ) throws IOException
  {
    RequestFileAttachment fileAttachment = new RequestFileAttachment( file, cache, this );
    attachments.add( fileAttachment );
    notifyPropertyChanged( ATTACHMENTS_PROPERTY, null, fileAttachment );
    return fileAttachment;
  }
View Full Code Here

  {
    if( attachment instanceof FileAttachment<?> )
    {
      AttachmentConfig oldConfig = ( ( FileAttachment<?> )attachment ).getConfig();
      AttachmentConfig newConfig = ( AttachmentConfig )getConfig().addNewAttachment().set( oldConfig );
      RequestFileAttachment newAttachment = new RequestFileAttachment( newConfig, this );
      attachments.add( newAttachment );
      return newAttachment;
    }
    else
      log.error( "Unkown attachment type: " + attachment );
View Full Code Here

      while( bytesMessageReceive.readBytes( buff ) != -1 )
      {
        out.write( buff );
      }
      out.close();
      Attachment[] attachments = new Attachment[] { new RequestFileAttachment( temp, false,
          ( AbstractHttpRequest<?> )request ) };
      jmsResponse.setAttachments( attachments );
    }
    catch( IOException e )
    {
View Full Code Here

  private RequestFileAttachment createMissingAttachment( HttpRequest request, URL url,
      FailingHttpStatusCodeException fhsce ) throws IOException
  {
    File temp = new File( fhsce.getStatusCode() + "_" + fhsce.getStatusMessage() + "_" + url.toString() );
    RequestFileAttachment missingFile = new RequestFileAttachment( temp, false, ( AbstractHttpRequest<?> )request );
    missingResourcesList.add( fhsce.getStatusCode() + " " + fhsce.getStatusMessage() + " " + url.toString() );
    return missingFile;
  }
View Full Code Here

    File temp = File.createTempFile( fileName, extension );
    OutputStream out = new FileOutputStream( temp );
    out.write( bytes );
    out.close();
    return new RequestFileAttachment( temp, false, ( AbstractHttpRequest<?> )request );
  }
View Full Code Here

   * com.eviware.soapui.impl.wsdl.AttachmentContainer#attachFile(java.io.File,
   * boolean)
   */

    public Attachment attachFile(File file, boolean cache) throws IOException {
        RequestFileAttachment fileAttachment = new RequestFileAttachment(file, cache, this);
        attachments.add(fileAttachment);
        notifyPropertyChanged(ATTACHMENTS_PROPERTY, null, fileAttachment);
        return fileAttachment;
    }
View Full Code Here

    public Attachment importAttachment(Attachment attachment) {
        if (attachment instanceof FileAttachment<?>) {
            AttachmentConfig oldConfig = ((FileAttachment<?>) attachment).getConfig();
            AttachmentConfig newConfig = (AttachmentConfig) getConfig().addNewAttachment().set(oldConfig);
            RequestFileAttachment newAttachment = new RequestFileAttachment(newConfig, this);
            attachments.add(newAttachment);
            return newAttachment;
        } else {
            log.error("Unknown attachment type: " + attachment);
        }
View Full Code Here

        dumpFile = new SettingPathPropertySupport(this, DUMP_FILE);
    }

    private void initAttachments() {
        for (AttachmentConfig ac : getConfig().getAttachmentList()) {
            RequestFileAttachment attachment = new RequestFileAttachment(ac, this);
            attachments.add(attachment);
        }
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.support.RequestFileAttachment

Copyright © 2018 www.massapicom. 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.