Examples of DeferredFileOutputStream


Examples of org.apache.wicket.util.io.DeferredFileOutputStream

  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      File outputFile = getTempFile();
      dfos = new DeferredFileOutputStream(sizeThreshold, outputFile);
    }
    return dfos;
  }
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

  @Override
  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      dfos = new DeferredFileOutputStream(sizeThreshold,
        new DeferredFileOutputStream.FileFactory()
        {
          @Override
          public File createFile()
          {
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

   */
  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      dfos = new DeferredFileOutputStream(sizeThreshold,
        new DeferredFileOutputStream.FileFactory()
        {
          public File createFile()
          {
            return getTempFile();
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      File outputFile = getTempFile();
      dfos = new DeferredFileOutputStream(sizeThreshold, outputFile);
    }
    return dfos;
  }
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      File outputFile = getTempFile();
      dfos = new DeferredFileOutputStream(sizeThreshold, outputFile);
    }
    return dfos;
  }
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

   */
  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      dfos = new DeferredFileOutputStream(sizeThreshold,
        new DeferredFileOutputStream.FileFactory()
        {
          public File createFile()
          {
            return getTempFile();
View Full Code Here

Examples of org.apache.wicket.util.io.DeferredFileOutputStream

  @Override
  public OutputStream getOutputStream() throws IOException
  {
    if (dfos == null)
    {
      dfos = new DeferredFileOutputStream(sizeThreshold,
        new DeferredFileOutputStream.FileFactory()
        {
          @Override
          public File createFile()
          {
View Full Code Here

Examples of org.subethamail.smtp.io.DeferredFileOutputStream

        Delivery delivery = this.deliveries.get(0);
        delivery.getListener().deliver(this.from, delivery.getRecipient(), data);
      }
      else
      {
        DeferredFileOutputStream dfos = new DeferredFileOutputStream(SimpleMessageListenerAdapter.this.dataDeferredSize);

        try
        {
          int value;
          while ((value = data.read()) >= 0)
          {
            dfos.write(value);
          }

          for (Delivery delivery: this.deliveries)
          {
            delivery.getListener().deliver(this.from, delivery.getRecipient(), dfos.getInputStream());
          }
        }
        finally
        {
          dfos.close();
        }
      }
    }
View Full Code Here

Examples of org.subethamail.smtp.io.DeferredFileOutputStream

    }

    @Override
    public void data(InputStream data) throws RejectException,
            TooMuchDataException, IOException {
        DeferredFileOutputStream deferredFileOutputStream = null;
        DeferredFileMailData deferredFileMailData = null;
        try {
            deferredFileOutputStream = copyDataToDeferredFileOutputStream(data);
            deferredFileMailData =
                    new DeferredFileMailData(deferredFileOutputStream);
            mailTransaction.setData(deferredFileMailData);
            filterChain.getHead().data(mailTransaction.getData());
            checkResponsibilityHasBeenTakenForAllRecipients();
        } catch (RejectExceptionExt e) {
            throw e.toRejectException();
        } finally {
            if (mailTransaction.getData() != null)
                mailTransaction.getData().dispose();
            if (deferredFileOutputStream != null)
                deferredFileOutputStream.close();
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.io.DeferredFileOutputStream

    }

    private DeferredFileOutputStream copyDataToDeferredFileOutputStream(
            InputStream src) throws IOException {
        byte[] buffer = new byte[8192];
        DeferredFileOutputStream deferredFileOutputStream =
                new DeferredFileOutputStream(32768);
        int cRead;
        while ((cRead = src.read(buffer)) > 0) {
            deferredFileOutputStream.write(buffer, 0, cRead);
        }
        return deferredFileOutputStream;
    }
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.