Package jodd.http.up

Examples of jodd.http.up.Uploadable


          buffer.append("Content-Disposition: form-data; name=\"").append(name).append('"').append(CRLF);
          buffer.append(CRLF);
          buffer.append(string);
        }
        else if (value instanceof Uploadable) {
          Uploadable uploadable = (Uploadable) value;

          String fileName = uploadable.getFileName();
          if (fileName == null) {
            fileName = name;
          }

          buffer.append("Content-Disposition: form-data; name=\"").append(name);
          buffer.append("\"; filename=\"").append(fileName).append('"').append(CRLF);

          String mimeType = uploadable.getMimeType();
          if (mimeType == null) {
            mimeType = MimeTypes.getMimeType(FileNameUtil.getExtension(fileName));
          }
          buffer.append(HEADER_CONTENT_TYPE).append(": ").append(mimeType).append(CRLF);
View Full Code Here


        byte[] array = fastByteBuffer.toArray();

        writer.write(new String(array, StringPool.ISO_8859_1));
      }
      else if (o instanceof Uploadable) {
        Uploadable uploadable = (Uploadable) o;

        InputStream inputStream = uploadable.openInputStream();

        try {
          StreamUtil.copy(inputStream, writer, StringPool.ISO_8859_1);
        }
        finally {
View Full Code Here

        FastByteBuffer fastByteBuffer = (FastByteBuffer) o;

        out.write(fastByteBuffer.toArray());
      }
      else if (o instanceof Uploadable) {
        Uploadable uploadable = (Uploadable) o;

        InputStream inputStream = uploadable.openInputStream();

        try {
          StreamUtil.copy(inputStream, out);
        }
        finally {
View Full Code Here

            step -= callbackSize;
          }
        }
      }
      else if (o instanceof Uploadable) {
        Uploadable uploadable = (Uploadable) o;

        InputStream inputStream = uploadable.openInputStream();

        int remaining = uploadable.getSize();

        try {
          while (remaining > 0) {
            // calc the remaining sending chunk size
            int chunk = callbackSize - step;
View Full Code Here

TOP

Related Classes of jodd.http.up.Uploadable

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.