public class MultiPartContentProvider extends AbstractTypedContentProvider implements AsyncContentProvider, Closeable
AsyncContentProvider.ListenerContentProvider.Typed| 构造器和说明 |
|---|
MultiPartContentProvider() |
MultiPartContentProvider(String boundary) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFieldPart(String name,
ContentProvider content,
HttpFields fields)
Adds a field part with the given
name as field name, and the given
content as part content. |
void |
addFilePart(String name,
String fileName,
ContentProvider content,
HttpFields fields)
Adds a file part with the given
name as field name, the given
fileName as file name, and the given content as part content. |
void |
close() |
long |
getLength() |
Iterator<ByteBuffer> |
iterator() |
void |
setListener(AsyncContentProvider.Listener listener) |
getContentTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic MultiPartContentProvider()
public MultiPartContentProvider(String boundary)
public void addFieldPart(String name, ContentProvider content, HttpFields fields)
Adds a field part with the given name as field name, and the given
content as part content.
name - the part namecontent - the part contentfields - the headers associated with this partpublic void addFilePart(String name, String fileName, ContentProvider content, HttpFields fields)
Adds a file part with the given name as field name, the given
fileName as file name, and the given content as part content.
name - the part namefileName - the file name associated to this partcontent - the part contentfields - the headers associated with this partpublic void setListener(AsyncContentProvider.Listener listener)
setListener 在接口中 AsyncContentProviderlistener - the listener to be notified of content availabilitypublic long getLength()
getLength 在接口中 ContentProviderpublic Iterator<ByteBuffer> iterator()
iterator 在接口中 Iterable<ByteBuffer>public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2017. All rights reserved.