All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jodd.upload.impl.MemoryFileUploadFactory Maven / Gradle / Ivy

// Copyright (c) 2003-2013, Jodd Team (jodd.org). All Rights Reserved.

package jodd.upload.impl;

import jodd.upload.FileUploadFactory;
import jodd.upload.FileUpload;
import jodd.upload.MultipartRequestInputStream;

/**
 * Factory for {@link jodd.upload.impl.MemoryFileUpload}.
 */
public class MemoryFileUploadFactory implements FileUploadFactory {

	protected int maxFileSize = 102400;

	public int getMaxFileSize() {
		return maxFileSize;
	}

	/**
	 * Sets maximum file upload size. Setting to -1 will disable this constraint.
	 */
	public MemoryFileUploadFactory setMaxFileSize(int maxFileSize) {
		this.maxFileSize = maxFileSize;
		return this;
	}

	/**
	 * {@inheritDoc}
	 */
	public FileUpload create(MultipartRequestInputStream input) {
		return new MemoryFileUpload(input, maxFileSize);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy