httpmime-4.1.2

16:36:46.634 INFO  jd.cli.Main - Decompiling httpmime-4.1.2.jar
package org.apache.http.entity.mime;

class HttpMultipart$1
{
  static
  {
    try
    {
      $SwitchMap$org$apache$http$entity$mime$HttpMultipartMode[HttpMultipartMode.STRICT.ordinal()] = 1;
    }
    catch (NoSuchFieldError ex) {}
    try
    {
      $SwitchMap$org$apache$http$entity$mime$HttpMultipartMode[HttpMultipartMode.BROWSER_COMPATIBLE.ordinal()] = 2;
    }
    catch (NoSuchFieldError ex) {}
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.HttpMultipart.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

public enum HttpMultipartMode
{
  STRICT,  BROWSER_COMPATIBLE;
  
  private HttpMultipartMode() {}
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.HttpMultipartMode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

import java.nio.charset.Charset;

public final class MIME
{
  public static final String CONTENT_TYPE = "Content-Type";
  public static final String CONTENT_TRANSFER_ENC = "Content-Transfer-Encoding";
  public static final String CONTENT_DISPOSITION = "Content-Disposition";
  public static final String ENC_8BIT = "8bit";
  public static final String ENC_BINARY = "binary";
  public static final Charset DEFAULT_CHARSET = Charset.forName("US-ASCII");
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.MIME
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

public class MinimalField
{
  private final String name;
  private final String value;
  
  MinimalField(String name, String value)
  {
    this.name = name;
    this.value = value;
  }
  
  public String getName()
  {
    return name;
  }
  
  public String getBody()
  {
    return value;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append(name);
    buffer.append(": ");
    buffer.append(value);
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.MinimalField
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public class Header
  implements Iterable<MinimalField>
{
  private final List<MinimalField> fields;
  private final Map<String, List<MinimalField>> fieldMap;
  
  public Header()
  {
    fields = new LinkedList();
    fieldMap = new HashMap();
  }
  
  public void addField(MinimalField field)
  {
    if (field == null) {
      return;
    }
    String key = field.getName().toLowerCase(Locale.US);
    List<MinimalField> values = (List)fieldMap.get(key);
    if (values == null)
    {
      values = new LinkedList();
      fieldMap.put(key, values);
    }
    values.add(field);
    fields.add(field);
  }
  
  public List<MinimalField> getFields()
  {
    return new ArrayList(fields);
  }
  
  public MinimalField getField(String name)
  {
    if (name == null) {
      return null;
    }
    String key = name.toLowerCase(Locale.US);
    List<MinimalField> list = (List)fieldMap.get(key);
    if ((list != null) && (!list.isEmpty())) {
      return (MinimalField)list.get(0);
    }
    return null;
  }
  
  public List<MinimalField> getFields(String name)
  {
    if (name == null) {
      return null;
    }
    String key = name.toLowerCase(Locale.US);
    List<MinimalField> list = (List)fieldMap.get(key);
    if ((list == null) || (list.isEmpty())) {
      return Collections.emptyList();
    }
    return new ArrayList(list);
  }
  
  public int removeFields(String name)
  {
    if (name == null) {
      return 0;
    }
    String key = name.toLowerCase(Locale.US);
    List<MinimalField> removed = (List)fieldMap.remove(key);
    if ((removed == null) || (removed.isEmpty())) {
      return 0;
    }
    fields.removeAll(removed);
    return removed.size();
  }
  
  public void setField(MinimalField field)
  {
    if (field == null) {
      return;
    }
    String key = field.getName().toLowerCase(Locale.US);
    List<MinimalField> list = (List)fieldMap.get(key);
    if ((list == null) || (list.isEmpty()))
    {
      addField(field);
      return;
    }
    list.clear();
    list.add(field);
    int firstOccurrence = -1;
    int index = 0;
    for (Iterator<MinimalField> it = fields.iterator(); it.hasNext(); index++)
    {
      MinimalField f = (MinimalField)it.next();
      if (f.getName().equalsIgnoreCase(field.getName()))
      {
        it.remove();
        if (firstOccurrence == -1) {
          firstOccurrence = index;
        }
      }
    }
    fields.add(firstOccurrence, field);
  }
  
  public Iterator<MinimalField> iterator()
  {
    return Collections.unmodifiableList(fields).iterator();
  }
  
  public String toString()
  {
    return fields.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.Header
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

public abstract interface ContentDescriptor
{
  public abstract String getMimeType();
  
  public abstract String getMediaType();
  
  public abstract String getSubType();
  
  public abstract String getCharset();
  
  public abstract String getTransferEncoding();
  
  public abstract long getContentLength();
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.ContentDescriptor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileBody
  extends AbstractContentBody
{
  private final File file;
  private final String filename;
  private final String charset;
  
  public FileBody(File file, String filename, String mimeType, String charset)
  {
    super(mimeType);
    if (file == null) {
      throw new IllegalArgumentException("File may not be null");
    }
    this.file = file;
    if (filename != null) {
      this.filename = filename;
    } else {
      this.filename = file.getName();
    }
    this.charset = charset;
  }
  
  public FileBody(File file, String mimeType, String charset)
  {
    this(file, null, mimeType, charset);
  }
  
  public FileBody(File file, String mimeType)
  {
    this(file, mimeType, null);
  }
  
  public FileBody(File file)
  {
    this(file, "application/octet-stream");
  }
  
  public InputStream getInputStream()
    throws IOException
  {
    return new FileInputStream(file);
  }
  
  @Deprecated
  public void writeTo(OutputStream out, int mode)
    throws IOException
  {
    writeTo(out);
  }
  
  public void writeTo(OutputStream out)
    throws IOException
  {
    if (out == null) {
      throw new IllegalArgumentException("Output stream may not be null");
    }
    InputStream in = new FileInputStream(file);
    try
    {
      byte[] tmp = new byte['?'];
      int l;
      while ((l = in.read(tmp)) != -1) {
        out.write(tmp, 0, l);
      }
      out.flush();
    }
    finally
    {
      in.close();
    }
  }
  
  public String getTransferEncoding()
  {
    return "binary";
  }
  
  public String getCharset()
  {
    return charset;
  }
  
  public long getContentLength()
  {
    return file.length();
  }
  
  public String getFilename()
  {
    return filename;
  }
  
  public File getFile()
  {
    return file;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.FileBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

import java.io.IOException;
import java.io.OutputStream;

public abstract interface ContentBody
  extends ContentDescriptor
{
  public abstract String getFilename();
  
  public abstract void writeTo(OutputStream paramOutputStream)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.ContentBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class InputStreamBody
  extends AbstractContentBody
{
  private final InputStream in;
  private final String filename;
  
  public InputStreamBody(InputStream in, String mimeType, String filename)
  {
    super(mimeType);
    if (in == null) {
      throw new IllegalArgumentException("Input stream may not be null");
    }
    this.in = in;
    this.filename = filename;
  }
  
  public InputStreamBody(InputStream in, String filename)
  {
    this(in, "application/octet-stream", filename);
  }
  
  public InputStream getInputStream()
  {
    return in;
  }
  
  @Deprecated
  public void writeTo(OutputStream out, int mode)
    throws IOException
  {
    writeTo(out);
  }
  
  public void writeTo(OutputStream out)
    throws IOException
  {
    if (out == null) {
      throw new IllegalArgumentException("Output stream may not be null");
    }
    try
    {
      byte[] tmp = new byte['?'];
      int l;
      while ((l = in.read(tmp)) != -1) {
        out.write(tmp, 0, l);
      }
      out.flush();
    }
    finally
    {
      in.close();
    }
  }
  
  public String getTransferEncoding()
  {
    return "binary";
  }
  
  public String getCharset()
  {
    return null;
  }
  
  public long getContentLength()
  {
    return -1L;
  }
  
  public String getFilename()
  {
    return filename;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.InputStreamBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;

public class StringBody
  extends AbstractContentBody
{
  private final byte[] content;
  private final Charset charset;
  
  public static StringBody create(String text, String mimeType, Charset charset)
    throws IllegalArgumentException
  {
    try
    {
      return new StringBody(text, mimeType, charset);
    }
    catch (UnsupportedEncodingException ex)
    {
      throw new IllegalArgumentException("Charset " + charset + " is not supported", ex);
    }
  }
  
  public static StringBody create(String text, Charset charset)
    throws IllegalArgumentException
  {
    return create(text, null, charset);
  }
  
  public static StringBody create(String text)
    throws IllegalArgumentException
  {
    return create(text, null, null);
  }
  
  public StringBody(String text, String mimeType, Charset charset)
    throws UnsupportedEncodingException
  {
    super(mimeType);
    if (text == null) {
      throw new IllegalArgumentException("Text may not be null");
    }
    if (charset == null) {
      charset = Charset.forName("US-ASCII");
    }
    content = text.getBytes(charset.name());
    this.charset = charset;
  }
  
  public StringBody(String text, Charset charset)
    throws UnsupportedEncodingException
  {
    this(text, "text/plain", charset);
  }
  
  public StringBody(String text)
    throws UnsupportedEncodingException
  {
    this(text, "text/plain", null);
  }
  
  public Reader getReader()
  {
    return new InputStreamReader(new ByteArrayInputStream(content), charset);
  }
  
  @Deprecated
  public void writeTo(OutputStream out, int mode)
    throws IOException
  {
    writeTo(out);
  }
  
  public void writeTo(OutputStream out)
    throws IOException
  {
    if (out == null) {
      throw new IllegalArgumentException("Output stream may not be null");
    }
    InputStream in = new ByteArrayInputStream(content);
    byte[] tmp = new byte['?'];
    int l;
    while ((l = in.read(tmp)) != -1) {
      out.write(tmp, 0, l);
    }
    out.flush();
  }
  
  public String getTransferEncoding()
  {
    return "8bit";
  }
  
  public String getCharset()
  {
    return charset.name();
  }
  
  public long getContentLength()
  {
    return content.length;
  }
  
  public String getFilename()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.StringBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

public abstract class AbstractContentBody
  implements ContentBody
{
  private final String mimeType;
  private final String mediaType;
  private final String subType;
  
  public AbstractContentBody(String mimeType)
  {
    if (mimeType == null) {
      throw new IllegalArgumentException("MIME type may not be null");
    }
    this.mimeType = mimeType;
    int i = mimeType.indexOf('/');
    if (i != -1)
    {
      mediaType = mimeType.substring(0, i);
      subType = mimeType.substring(i + 1);
    }
    else
    {
      mediaType = mimeType;
      subType = null;
    }
  }
  
  public String getMimeType()
  {
    return mimeType;
  }
  
  public String getMediaType()
  {
    return mediaType;
  }
  
  public String getSubType()
  {
    return subType;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.AbstractContentBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime.content;

import java.io.IOException;
import java.io.OutputStream;

public class ByteArrayBody
  extends AbstractContentBody
{
  private final byte[] data;
  private final String filename;
  
  public ByteArrayBody(byte[] data, String mimeType, String filename)
  {
    super(mimeType);
    if (data == null) {
      throw new IllegalArgumentException("byte[] may not be null");
    }
    this.data = data;
    this.filename = filename;
  }
  
  public ByteArrayBody(byte[] data, String filename)
  {
    this(data, "application/octet-stream", filename);
  }
  
  public String getFilename()
  {
    return filename;
  }
  
  public void writeTo(OutputStream out)
    throws IOException
  {
    out.write(data);
  }
  
  public String getCharset()
  {
    return null;
  }
  
  public String getTransferEncoding()
  {
    return "binary";
  }
  
  public long getContentLength()
  {
    return data.length;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.content.ByteArrayBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.entity.mime.content.ContentBody;
import org.apache.http.util.ByteArrayBuffer;

public class HttpMultipart
{
  private static ByteArrayBuffer encode(Charset charset, String string)
  {
    ByteBuffer encoded = charset.encode(CharBuffer.wrap(string));
    ByteArrayBuffer bab = new ByteArrayBuffer(encoded.remaining());
    bab.append(encoded.array(), encoded.position(), encoded.remaining());
    return bab;
  }
  
  private static void writeBytes(ByteArrayBuffer b, OutputStream out)
    throws IOException
  {
    out.write(b.buffer(), 0, b.length());
  }
  
  private static void writeBytes(String s, Charset charset, OutputStream out)
    throws IOException
  {
    ByteArrayBuffer b = encode(charset, s);
    writeBytes(b, out);
  }
  
  private static void writeBytes(String s, OutputStream out)
    throws IOException
  {
    ByteArrayBuffer b = encode(MIME.DEFAULT_CHARSET, s);
    writeBytes(b, out);
  }
  
  private static void writeField(MinimalField field, OutputStream out)
    throws IOException
  {
    writeBytes(field.getName(), out);
    writeBytes(FIELD_SEP, out);
    writeBytes(field.getBody(), out);
    writeBytes(CR_LF, out);
  }
  
  private static void writeField(MinimalField field, Charset charset, OutputStream out)
    throws IOException
  {
    writeBytes(field.getName(), charset, out);
    writeBytes(FIELD_SEP, out);
    writeBytes(field.getBody(), charset, out);
    writeBytes(CR_LF, out);
  }
  
  private static final ByteArrayBuffer FIELD_SEP = encode(MIME.DEFAULT_CHARSET, ": ");
  private static final ByteArrayBuffer CR_LF = encode(MIME.DEFAULT_CHARSET, "\r\n");
  private static final ByteArrayBuffer TWO_DASHES = encode(MIME.DEFAULT_CHARSET, "--");
  private final String subType;
  private final Charset charset;
  private final String boundary;
  private final List<FormBodyPart> parts;
  private final HttpMultipartMode mode;
  
  public HttpMultipart(String subType, Charset charset, String boundary, HttpMultipartMode mode)
  {
    if (subType == null) {
      throw new IllegalArgumentException("Multipart subtype may not be null");
    }
    if (boundary == null) {
      throw new IllegalArgumentException("Multipart boundary may not be null");
    }
    this.subType = subType;
    this.charset = (charset != null ? charset : MIME.DEFAULT_CHARSET);
    this.boundary = boundary;
    parts = new ArrayList();
    this.mode = mode;
  }
  
  public HttpMultipart(String subType, Charset charset, String boundary)
  {
    this(subType, charset, boundary, HttpMultipartMode.STRICT);
  }
  
  public HttpMultipart(String subType, String boundary)
  {
    this(subType, null, boundary);
  }
  
  public String getSubType()
  {
    return subType;
  }
  
  public Charset getCharset()
  {
    return charset;
  }
  
  public HttpMultipartMode getMode()
  {
    return mode;
  }
  
  public List<FormBodyPart> getBodyParts()
  {
    return parts;
  }
  
  public void addBodyPart(FormBodyPart part)
  {
    if (part == null) {
      return;
    }
    parts.add(part);
  }
  
  public String getBoundary()
  {
    return boundary;
  }
  
  private void doWriteTo(HttpMultipartMode mode, OutputStream out, boolean writeContent)
    throws IOException
  {
    ByteArrayBuffer boundary = encode(charset, getBoundary());
    for (FormBodyPart part : parts)
    {
      writeBytes(TWO_DASHES, out);
      writeBytes(boundary, out);
      writeBytes(CR_LF, out);
      
      Header header = part.getHeader();
      switch (mode)
      {
      case STRICT: 
        for (MinimalField field : header) {
          writeField(field, out);
        }
        break;
      case BROWSER_COMPATIBLE: 
        MinimalField cd = part.getHeader().getField("Content-Disposition");
        writeField(cd, charset, out);
        String filename = part.getBody().getFilename();
        if (filename != null)
        {
          MinimalField ct = part.getHeader().getField("Content-Type");
          writeField(ct, charset, out);
        }
        break;
      }
      writeBytes(CR_LF, out);
      if (writeContent) {
        part.getBody().writeTo(out);
      }
      writeBytes(CR_LF, out);
    }
    writeBytes(TWO_DASHES, out);
    writeBytes(boundary, out);
    writeBytes(TWO_DASHES, out);
    writeBytes(CR_LF, out);
  }
  
  public void writeTo(OutputStream out)
    throws IOException
  {
    doWriteTo(mode, out, true);
  }
  
  public long getTotalLength()
  {
    long contentLen = 0L;
    for (FormBodyPart part : parts)
    {
      ContentBody body = part.getBody();
      long len = body.getContentLength();
      if (len >= 0L) {
        contentLen += len;
      } else {
        return -1L;
      }
    }
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try
    {
      doWriteTo(mode, out, false);
      byte[] extra = out.toByteArray();
      return contentLen + extra.length;
    }
    catch (IOException ex) {}
    return -1L;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.HttpMultipart
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

import org.apache.http.entity.mime.content.ContentBody;

public class FormBodyPart
{
  private final String name;
  private final Header header;
  private final ContentBody body;
  
  public FormBodyPart(String name, ContentBody body)
  {
    if (name == null) {
      throw new IllegalArgumentException("Name may not be null");
    }
    if (body == null) {
      throw new IllegalArgumentException("Body may not be null");
    }
    this.name = name;
    this.body = body;
    header = new Header();
    
    generateContentDisp(body);
    generateContentType(body);
    generateTransferEncoding(body);
  }
  
  public String getName()
  {
    return name;
  }
  
  public ContentBody getBody()
  {
    return body;
  }
  
  public Header getHeader()
  {
    return header;
  }
  
  public void addField(String name, String value)
  {
    if (name == null) {
      throw new IllegalArgumentException("Field name may not be null");
    }
    header.addField(new MinimalField(name, value));
  }
  
  protected void generateContentDisp(ContentBody body)
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append("form-data; name=\"");
    buffer.append(getName());
    buffer.append("\"");
    if (body.getFilename() != null)
    {
      buffer.append("; filename=\"");
      buffer.append(body.getFilename());
      buffer.append("\"");
    }
    addField("Content-Disposition", buffer.toString());
  }
  
  protected void generateContentType(ContentBody body)
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append(body.getMimeType());
    if (body.getCharset() != null)
    {
      buffer.append("; charset=");
      buffer.append(body.getCharset());
    }
    addField("Content-Type", buffer.toString());
  }
  
  protected void generateTransferEncoding(ContentBody body)
  {
    addField("Content-Transfer-Encoding", body.getTransferEncoding());
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.FormBodyPart
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.entity.mime;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Random;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.entity.mime.content.ContentBody;
import org.apache.http.message.BasicHeader;

public class MultipartEntity
  implements HttpEntity
{
  private static final char[] MULTIPART_CHARS = "-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
  private final HttpMultipart multipart;
  private final Header contentType;
  private long length;
  private volatile boolean dirty;
  
  public MultipartEntity(HttpMultipartMode mode, String boundary, Charset charset)
  {
    if (boundary == null) {
      boundary = generateBoundary();
    }
    if (mode == null) {
      mode = HttpMultipartMode.STRICT;
    }
    multipart = new HttpMultipart("form-data", charset, boundary, mode);
    contentType = new BasicHeader("Content-Type", generateContentType(boundary, charset));
    
    dirty = true;
  }
  
  public MultipartEntity(HttpMultipartMode mode)
  {
    this(mode, null, null);
  }
  
  public MultipartEntity()
  {
    this(HttpMultipartMode.STRICT, null, null);
  }
  
  protected String generateContentType(String boundary, Charset charset)
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append("multipart/form-data; boundary=");
    buffer.append(boundary);
    if (charset != null)
    {
      buffer.append("; charset=");
      buffer.append(charset.name());
    }
    return buffer.toString();
  }
  
  protected String generateBoundary()
  {
    StringBuilder buffer = new StringBuilder();
    Random rand = new Random();
    int count = rand.nextInt(11) + 30;
    for (int i = 0; i < count; i++) {
      buffer.append(MULTIPART_CHARS[rand.nextInt(MULTIPART_CHARS.length)]);
    }
    return buffer.toString();
  }
  
  public void addPart(FormBodyPart bodyPart)
  {
    multipart.addBodyPart(bodyPart);
    dirty = true;
  }
  
  public void addPart(String name, ContentBody contentBody)
  {
    addPart(new FormBodyPart(name, contentBody));
  }
  
  public boolean isRepeatable()
  {
    for (FormBodyPart part : multipart.getBodyParts())
    {
      ContentBody body = part.getBody();
      if (body.getContentLength() < 0L) {
        return false;
      }
    }
    return true;
  }
  
  public boolean isChunked()
  {
    return !isRepeatable();
  }
  
  public boolean isStreaming()
  {
    return !isRepeatable();
  }
  
  public long getContentLength()
  {
    if (dirty)
    {
      length = multipart.getTotalLength();
      dirty = false;
    }
    return length;
  }
  
  public Header getContentType()
  {
    return contentType;
  }
  
  public Header getContentEncoding()
  {
    return null;
  }
  
  public void consumeContent()
    throws IOException, UnsupportedOperationException
  {
    if (isStreaming()) {
      throw new UnsupportedOperationException("Streaming entity does not implement #consumeContent()");
    }
  }
  
  public InputStream getContent()
    throws IOException, UnsupportedOperationException
  {
    throw new UnsupportedOperationException("Multipart form entity does not implement #getContent()");
  }
  
  public void writeTo(OutputStream outstream)
    throws IOException
  {
    multipart.writeTo(outstream);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.entity.mime.MultipartEntity
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd