Java 类org.apache.commons.fileupload.FileItemHeaders 实例源码

项目:nio-multipart    文件:FunctionalTest.java   
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());
}
项目:nio-multipart    文件:FunctionalTest.java   
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);
        }

    }
项目:spring4-understanding    文件:CommonsMultipartResolverTests.java   
@Override
public FileItemHeaders getHeaders() {
    throw new UnsupportedOperationException();
}
项目:spring4-understanding    文件:CommonsMultipartResolverTests.java   
@Override
public void setHeaders(FileItemHeaders headers) {
    throw new UnsupportedOperationException();
}
项目:appformer    文件:M2RepositoryServiceImplTest.java   
@Override
public FileItemHeaders getHeaders() {
    return null;
}
项目:appformer    文件:M2RepositoryServiceImplTest.java   
@Override
public void setHeaders(FileItemHeaders fileItemHeaders) {
}
项目:ttt    文件:FragmentItemStream.java   
public FileItemHeaders getHeaders() {
    return null;
}
项目:ttt    文件:FragmentItemStream.java   
public void setHeaders(FileItemHeaders headers) {
}
项目:ttt    文件:UrlItemStream.java   
public FileItemHeaders getHeaders() {
    return null;
}
项目:ttt    文件:UrlItemStream.java   
public void setHeaders(FileItemHeaders headers) {
}
项目:Cindy    文件:FormFileItem.java   
@Override
public FileItemHeaders getHeaders() {
    return null;
}
项目:Cindy    文件:FormFileItem.java   
@Override
public void setHeaders(FileItemHeaders headers) {
    throw new RuntimeException("Invalid operation on FormFileItem");
}
项目:Cindy    文件:BodyFileItem.java   
@Override
public FileItemHeaders getHeaders() {
    return null;
}
项目:Cindy    文件:BodyFileItem.java   
@Override
public void setHeaders(FileItemHeaders headers) {
    throw new RuntimeException("Invalid operation on BodyFileItem");
}
项目:class-guard    文件:CommonsMultipartResolverTests.java   
@Override
public FileItemHeaders getHeaders() {
    throw new UnsupportedOperationException();
}
项目:class-guard    文件:CommonsMultipartResolverTests.java   
@Override
public void setHeaders(FileItemHeaders headers) {
    throw new UnsupportedOperationException();
}
项目:wmix    文件:ServletFileUpload.java   
@Override
protected String getFileName(FileItemHeaders headers) {
    return getFileName(headers.getHeader(CONTENT_DISPOSITION));
}
项目:lutece-core    文件:NormalizeFileItem.java   
/**
 * {@inheritDoc}
 */
@Override
public FileItemHeaders getHeaders( )
{
    return _item.getHeaders( );
}
项目:lutece-core    文件:NormalizeFileItem.java   
/**
 * {@inheritDoc}
 */
@Override
public void setHeaders( FileItemHeaders headers )
{
    _item.setHeaders( headers );
}
项目:metalcon    文件:ImageFileItem.java   
@Override
public FileItemHeaders getHeaders() {
    System.out.println("getHeaders");
    return null;
}
项目:metalcon    文件:ImageFileItem.java   
@Override
public void setHeaders(FileItemHeaders arg0) {
    System.out.println("setHeaders");
}
项目:vraptor4    文件:MockFileItem.java   
@Override
public FileItemHeaders getHeaders() {
    return null;
}
项目:vraptor4    文件:MockFileItem.java   
@Override
public void setHeaders(FileItemHeaders arg0) {
}
项目:gae-java-template    文件:InMemoryFileItem.java   
@Override
public FileItemHeaders getHeaders()
{
    return headers;
}
项目:gae-java-template    文件:InMemoryFileItem.java   
@Override
public void setHeaders(FileItemHeaders pHeaders)
{
    headers = pHeaders;
}
项目:gitplex-mit    文件:DiskFileItem.java   
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
项目:gitplex-mit    文件:DiskFileItem.java   
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
项目:WidgetStore    文件:DiskFileItem.java   
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
项目:WidgetStore    文件:DiskFileItem.java   
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
项目:wmix    文件:AbstractFileItem.java   
/**
 * Returns the file item headers.
 *
 * @return The file items headers.
 */
@Override
public FileItemHeaders getHeaders() {
    return headers;
}
项目:wmix    文件:AbstractFileItem.java   
/**
 * Sets the file item headers.
 *
 * @param pHeaders The file items headers.
 */
@Override
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
项目:cim    文件:DiskFileItem.java   
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
项目:cim    文件:DiskFileItem.java   
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
项目:AndroidWebServ    文件:DiskFileItem.java   
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
项目:AndroidWebServ    文件:DiskFileItem.java   
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}