Java Code Examples for org.apache.commons.fileupload.FileItemHeaders

The following examples show how to use org.apache.commons.fileupload.FileItemHeaders. These examples are extracted from open source projects. 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 Project: nio-multipart   Source File: FunctionalTest.java    License: 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 Project: nio-multipart   Source File: FunctionalTest.java    License: 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
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example 4
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example 5
Source Project: Mars-Java   Source File: DiskFileItem.java    License: 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 6
Source Project: Mars-Java   Source File: DiskFileItem.java    License: 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 7
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example 8
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example 9
@Override
public FileItemHeaders getHeaders() {
	throw new UnsupportedOperationException();
}
 
Example 10
@Override
public void setHeaders(FileItemHeaders headers) {
	throw new UnsupportedOperationException();
}
 
Example 11
Source Project: unitime   Source File: ScriptConnector.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {}
 
Example 12
Source Project: unitime   Source File: ScriptConnector.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() { return null; }
 
Example 13
Source Project: ttt   Source File: FragmentItemStream.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    return null;
}
 
Example 14
Source Project: ttt   Source File: FragmentItemStream.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setHeaders(FileItemHeaders headers) {
}
 
Example 15
Source Project: ttt   Source File: UrlItemStream.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    return null;
}
 
Example 16
Source Project: ttt   Source File: UrlItemStream.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setHeaders(FileItemHeaders headers) {
}
 
Example 17
/**
 * {@inheritDoc}
 */
@Override
public FileItemHeaders getHeaders( )
{
    return _item.getHeaders( );
}
 
Example 18
/**
 * {@inheritDoc}
 */
@Override
public void setHeaders( FileItemHeaders headers )
{
    _item.setHeaders( headers );
}
 
Example 19
Source Project: everrest   Source File: InMemoryFileItem.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
    return headers;
}
 
Example 20
Source Project: everrest   Source File: InMemoryFileItem.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders headers) {
    this.headers = headers;
}
 
Example 21
Source Project: metalcon   Source File: ImageFileItem.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	System.out.println("getHeaders");
	return null;
}
 
Example 22
Source Project: metalcon   Source File: ImageFileItem.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders arg0) {
	System.out.println("setHeaders");
}
 
Example 23
Source Project: javalite   Source File: ApacheFileItemFacade.java    License: Apache License 2.0 4 votes vote down vote up
public FileItemHeaders getHeaders() {
    throw new UnsupportedOperationException("not implemented");
}
 
Example 24
Source Project: javalite   Source File: ApacheFileItemFacade.java    License: Apache License 2.0 4 votes vote down vote up
public void setHeaders(FileItemHeaders fileItemHeaders) {
    throw new UnsupportedOperationException("not implemented");
}
 
Example 25
Source Project: vraptor4   Source File: MockFileItem.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public FileItemHeaders getHeaders() {
	return null;
}
 
Example 26
Source Project: vraptor4   Source File: MockFileItem.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setHeaders(FileItemHeaders arg0) {
}
 
Example 27
Source Project: onedev   Source File: DiskFileItem.java    License: MIT License 2 votes vote down vote up
/**
 * Returns the file item headers.
 * @return The file items headers.
 */
public FileItemHeaders getHeaders() {
    return headers;
}
 
Example 28
Source Project: onedev   Source File: DiskFileItem.java    License: 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 29
Source Project: lams   Source File: DiskFileItem.java    License: 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 30
Source Project: lams   Source File: DiskFileItem.java    License: 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;
}