FileItemStream item = iter.next(); String name = item.getFieldName(); InputStream stream = item.openStream();
if (iter.hasNext()) { FileItemStream item = iter.next(); String name = item.getFieldName();
formMap.put(item.getFieldName(), value); fileMap.put(item.getFieldName(), fileItem);
while (iter.hasNext()) { FileItemStream item = iter.next(); String name = item.getFieldName(); try (InputStream stream = item.openStream()) {
FileItem fileItem = fac.createItem(item.getFieldName(), item.getContentType(), item.isFormField(), fileName); items.add(fileItem);
assertEquals("file1", item.getFieldName()); assertEquals("foo1.tab", item.getName());
public FormPart(FileItemStream stream) { fieldName = stream.getFieldName(); contentType = stream.getContentType(); binaryContent = readBinaryContent(stream); fileName = stream.getName(); if(contentType == null || contentType.contains(MediaType.TEXT_PLAIN)) { textContent = new String(binaryContent); } }
public FormPart(FileItemStream stream) { fieldName = stream.getFieldName(); contentType = stream.getContentType(); binaryContent = readBinaryContent(stream); fileName = stream.getName(); if(contentType == null || contentType.contains(MediaType.TEXT_PLAIN)) { textContent = new String(binaryContent); } }
protected byte[] readBinaryContent(FileItemStream stream) { InputStream inputStream = getInputStream(stream); return IoUtil.readInputStream(inputStream, stream.getFieldName()); }
protected byte[] readBinaryContent(FileItemStream stream) { InputStream inputStream = getInputStream(stream); return IoUtil.readInputStream(inputStream, stream.getFieldName()); }
ServletFileUpload upload = new ServletFileUpload(factory); upload.setHeaderEncoding("UTF-8"); FileItemIterator iter = upload.getItemIterator(request); while (iter.hasNext()) { FileItemStream item = iter.next(); String name = item.getFieldName(); InputStream stream = item.openStream(); if (item.isFormField()) { String value = Streams.asString(stream, "UTF-8"); } }
FileItemStream item = iter.next(); if (item.isFormField()) { if ("token".equals(item.getFieldName())) { token = Streams.asString(item.openStream()); } else if ("poid".equals(item.getFieldName())) { poid = Long.parseLong(Streams.asString(item.openStream())); } else if ("comment".equals(item.getFieldName())) { comment = Streams.asString(item.openStream());
FileItemStream item = iter.next(); if (item.isFormField()) { if ("action".equals(item.getFieldName())) { action = Streams.asString(item.openStream()); } else if ("token".equals(item.getFieldName())) { token = Streams.asString(item.openStream()); } else if ("poid".equals(item.getFieldName())) { poid = Long.parseLong(Streams.asString(item.openStream())); } else if ("comment".equals(item.getFieldName())) { comment = Streams.asString(item.openStream()); } else if ("topicId".equals(item.getFieldName())) { topicId = Long.parseLong(Streams.asString(item.openStream())); } else if ("sync".equals(item.getFieldName())) { sync = Streams.asString(item.openStream()).equals("true"); } else if ("merge".equals(item.getFieldName())) { merge = Streams.asString(item.openStream()).equals("true"); } else if ("compression".equals(item.getFieldName())) { compression = Streams.asString(item.openStream()); } else if ("deserializerOid".equals(item.getFieldName())) { deserializerOid = Long.parseLong(Streams.asString(item.openStream()));
/** * Form field name. * * @return form field name */ public String getFieldName() { return fileItemStream.getFieldName(); }
import org.apache.commons.fileupload.util.Streams; ... FileItemStream item = iterator.next(); InputStream stream = item.openStream(); String name = item.getFieldName(); String value = Streams.asString(stream);
public AutoFileItem(FileItemStream stream) { this.fieldName = stream.getFieldName(); this.contentType = stream.getContentType(); this.isFormField = stream.isFormField(); this.fileName = FilenameUtils.getName(stream.getName()); this.sizeThreshold = Integer.parseInt(Play.configuration.getProperty("upload.threshold", "10240")); this.repository = null; } // ------------------------------- Methods from javax.activation.DataSource
public UploadedFormFieldApacheCommons(FileItemStream stream) throws IOException { InputStream in = stream.openStream(); name = stream.getFieldName(); value = Streams.asString(in); }
public FormPart(FileItemStream stream) { fieldName = stream.getFieldName(); contentType = stream.getContentType(); binaryContent = readBinaryContent(stream); fileName = stream.getName(); if(contentType == null || contentType.contains(MediaType.TEXT_PLAIN)) { textContent = new String(binaryContent); } }
public UploadedFormFieldApacheCommons(FileItemStream stream) throws IOException { InputStream in = stream.openStream(); name = stream.getFieldName(); value = Streams.asString(in); }
FileItemStream item = iter.next(); if(item.isFormField()) { // Normal field String name = item.getFieldName(); String value = Streams.asString(item.openStream()); } else { // File }