本文整理汇总了Java中org.apache.commons.fileupload.FileItemHeaders类的典型用法代码示例。如果您正苦于以下问题:Java FileItemHeaders类的具体用法?Java FileItemHeaders怎么用?Java FileItemHeaders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileItemHeaders类属于org.apache.commons.fileupload包,在下文中一共展示了FileItemHeaders类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertHeadersAreEqual
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
static void assertHeadersAreEqual(final FileItemHeaders fileItemHeaders, final Map<String, List<String>> headersFromPart){
int i = 0;
final Iterator<String> headerNamesIterator = fileItemHeaders.getHeaderNames();
while (headerNamesIterator.hasNext()){
i++;
String headerName = headerNamesIterator.next();
List<String> headerValues = Lists.newArrayList(fileItemHeaders.getHeaders(headerName));
List<String> headerValues1 = headersFromPart.get(headerName);
if (log.isDebugEnabled()){
log.debug("Commons io header values for '" + headerName + "': " + (headerValues != null ? Joiner.on(",").join(headerValues) : "null"));
log.debug("Nio multipart header values for '" + headerName + "': " + (headerValues1 != null ? Joiner.on(",").join(headerValues1) : "null"));
}
Assert.assertEquals(headerValues, headerValues1);
}
Assert.assertEquals(i, headersFromPart.size());
}
示例2: dumpFileIterator
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
void dumpFileIterator(final FileItemIterator fileItemIterator){
int partIndex = 0;
try {
log.info("-- COMMONS FILE UPLOAD --");
while (fileItemIterator.hasNext()) {
log.info("-- Part " + partIndex++);
FileItemStream fileItemStream = fileItemIterator.next();
FileItemHeaders fileItemHeaders = fileItemStream.getHeaders();
Iterator<String> headerNames = fileItemHeaders.getHeaderNames();
while(headerNames.hasNext()){
String headerName = headerNames.next();
log.info("Header: " + headerName+ ": " + Joiner.on(',').join(fileItemHeaders.getHeaders(headerName)));
}
log.info("Body:\n" + IOUtils.toString(fileItemStream.openStream()));
}
log.info("-- ------------------- --");
}catch (Exception e){
log.error("Error dumping the FileItemIterator", e);
}
}
示例3: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public FileItemHeaders getHeaders() {
throw new UnsupportedOperationException();
}
示例4: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public void setHeaders(FileItemHeaders headers) {
throw new UnsupportedOperationException();
}
示例5: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public FileItemHeaders getHeaders() {
return null;
}
示例6: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public void setHeaders(FileItemHeaders fileItemHeaders) {
}
示例7: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
public FileItemHeaders getHeaders() {
return null;
}
示例8: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
public void setHeaders(FileItemHeaders headers) {
}
示例9: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public FileItemHeaders getHeaders() {
return null;
}
示例10: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public void setHeaders(FileItemHeaders headers) {
throw new RuntimeException("Invalid operation on FormFileItem");
}
示例11: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public void setHeaders(FileItemHeaders headers) {
throw new RuntimeException("Invalid operation on BodyFileItem");
}
示例12: getFileName
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
protected String getFileName(FileItemHeaders headers) {
return getFileName(headers.getHeader(CONTENT_DISPOSITION));
}
示例13: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public FileItemHeaders getHeaders( )
{
return _item.getHeaders( );
}
示例14: setHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setHeaders( FileItemHeaders headers )
{
_item.setHeaders( headers );
}
示例15: getHeaders
import org.apache.commons.fileupload.FileItemHeaders; //导入依赖的package包/类
@Override
public FileItemHeaders getHeaders() {
System.out.println("getHeaders");
return null;
}