001
014
015 package com.liferay.portal.upload;
016
017 import java.io.File;
018
019 import org.apache.commons.fileupload.FileItem;
020 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
021
022
025 public class LiferayFileItemFactory extends DiskFileItemFactory {
026
027 public static final int DEFAULT_SIZE = 1024;
028
029 public LiferayFileItemFactory(File tempDir) {
030 _tempDir = tempDir;
031 }
032
033 @Override
034 public FileItem createItem(
035 String fieldName, String contentType, boolean isFormField,
036 String fileName) {
037
038 return new LiferayFileItem(
039 fieldName, contentType, isFormField, fileName, DEFAULT_SIZE,
040 _tempDir);
041 }
042
043 private File _tempDir;
044
045 }