|
|
|
@ -873,7 +873,8 @@ public final class httpd implements serverHandler, Cloneable {
|
|
|
|
|
*
|
|
|
|
|
* @author danielr
|
|
|
|
|
* @since 07.08.2008
|
|
|
|
|
* @param header hier muss ARGC gesetzt werden!
|
|
|
|
|
* @param header
|
|
|
|
|
* hier muss ARGC gesetzt werden!
|
|
|
|
|
* @param args
|
|
|
|
|
* @param in
|
|
|
|
|
* @param length
|
|
|
|
@ -881,13 +882,19 @@ public final class httpd implements serverHandler, Cloneable {
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
public static HashMap<String, byte[]> parseMultipart(final httpHeader header, final serverObjects args, final InputStream in, final int length) throws IOException {
|
|
|
|
|
RequestContext request = new yacyContextRequest(header, in);
|
|
|
|
|
|
|
|
|
|
public static HashMap<String, byte[]> parseMultipart(final httpHeader header, final serverObjects args, final InputStream in, final int length)
|
|
|
|
|
throws IOException {
|
|
|
|
|
// read all data from network in memory
|
|
|
|
|
byte[] buffer = serverFileUtils.read(in);
|
|
|
|
|
// parse data in memory
|
|
|
|
|
RequestContext request = new yacyContextRequest(header, new ByteArrayInputStream(buffer));
|
|
|
|
|
|
|
|
|
|
// check information
|
|
|
|
|
if (!FileUploadBase.isMultipartContent(request)) {
|
|
|
|
|
throw new IOException("the request is not a multipart-message!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// format information for further usage
|
|
|
|
|
FileItemFactory factory = new DiskFileItemFactory();
|
|
|
|
|
FileUpload upload = new FileUpload(factory);
|
|
|
|
|
List<FileItem> items;
|
|
|
|
|