org.apache.commons.fileupload.FileItemHeaders Java Examples

The following examples show how to use org.apache.commons.fileupload.FileItemHeaders. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FunctionalTest.java    From nio-multipart with Apache License 2.0 6 votes vote down vote up
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());
}
 
Example #2
Source File: FunctionalTest.java    From nio-multipart with Apache License 2.0 6 votes vote down vote up
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);
        }

    }
 
Example #3
Source File: FragmentItemStream.java    From ttt with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    return null;
}
 
Example #4
Source File: MockFileItem.java    From vraptor4 with Apache License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders arg0) {
}
 
Example #5
Source File: MockFileItem.java    From vraptor4 with Apache License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	return null;
}
 
Example #6
Source File: ApacheFileItemFacade.java    From javalite with Apache License 2.0 4 votes vote down vote up
public void setHeaders(FileItemHeaders fileItemHeaders) {
    throw new UnsupportedOperationException("not implemented");
}
 
Example #7
Source File: ApacheFileItemFacade.java    From javalite with Apache License 2.0 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    throw new UnsupportedOperationException("not implemented");
}
 
Example #8
Source File: ImageFileItem.java    From metalcon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders arg0) {
	System.out.println("setHeaders");
}
 
Example #9
Source File: ImageFileItem.java    From metalcon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	System.out.println("getHeaders");
	return null;
}
 
Example #10
Source File: InMemoryFileItem.java    From everrest with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {
    this.headers = headers;
}
 
Example #11
Source File: InMemoryFileItem.java    From everrest with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
    return headers;
}
 
Example #12
Source File: NormalizeFileItem.java    From lutece-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void setHeaders( FileItemHeaders headers )
{
    _item.setHeaders( headers );
}
 
Example #13
Source File: NormalizeFileItem.java    From lutece-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public FileItemHeaders getHeaders( )
{
    return _item.getHeaders( );
}
 
Example #14
Source File: UrlItemStream.java    From ttt with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setHeaders(FileItemHeaders headers) {
}
 
Example #15
Source File: UrlItemStream.java    From ttt with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    return null;
}
 
Example #16
Source File: FragmentItemStream.java    From ttt with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setHeaders(FileItemHeaders headers) {
}
 
Example #17
Source File: CommonsMultipartResolverTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example #18
Source File: ScriptConnector.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() { return null; }
 
Example #19
Source File: ScriptConnector.java    From unitime with Apache License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {}
 
Example #20
Source File: CommonsMultipartResolverTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example #21
Source File: CommonsMultipartResolverTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example #22
Source File: CommonsMultipartResolverTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example #23
Source File: CommonsMultipartResolverTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example #24
Source File: DiskFileItem.java    From Mars-Java with MIT License 4 votes vote down vote up
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
@Override
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
 
Example #25
Source File: DiskFileItem.java    From Mars-Java with MIT License 4 votes vote down vote up
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
@Override
public FileItemHeaders getHeaders() {
    return headers;
}
 
Example #26
Source File: CommonsMultipartResolverTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example #27
Source File: DiskFileItem.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
 
Example #28
Source File: DiskFileItem.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
 
Example #29
Source File: DiskFileItem.java    From onedev with MIT License 2 votes vote down vote up
/**
 * Sets the file item headers.
 * @param pHeaders The file items headers.
 */
public void setHeaders(FileItemHeaders pHeaders) {
    headers = pHeaders;
}
 
Example #30
Source File: DiskFileItem.java    From AndroidWebServ with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}