new DiskFileItemFactory(1048000, new File(System.getProperty("java.io.tmpdir"))); ServletFileUpload upload = new ServletFileUpload(factory); upload.setSizeMax(-1);
DiskFileItemFactory factory = new DiskFileItemFactory(); factory.setRepository(location); if (config.getFileSizeThreshold() > 0) { factory.setSizeThreshold(config.getFileSizeThreshold());
/** * Create a new {@link DiskFileItem} * instance from the supplied parameters and the local factory * configuration. * * @param fieldName The name of the form field. * @param contentType The content type of the form field. * @param isFormField <code>true</code> if this is a plain form field; * <code>false</code> otherwise. * @param fileName The name of the uploaded file, if any, as supplied * by the browser or other client. * * @return The newly created file item. */ public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { DiskFileItem result = new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, repository); FileCleaningTracker tracker = getFileCleaningTracker(); if (tracker != null) { tracker.track(result.getTempFile(), this); } return result; }
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
/** * Create a new {@link DiskFileItem} * instance from the supplied parameters and the local factory * configuration. * * @param fieldName The name of the form field. * @param contentType The content type of the form field. * @param isFormField <code>true</code> if this is a plain form field; * <code>false</code> otherwise. * @param fileName The name of the uploaded file, if any, as supplied * by the browser or other client. * * @return The newly created file item. */ public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { DiskFileItem result = new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, repository); FileCleaningTracker tracker = getFileCleaningTracker(); if (tracker != null) { tracker.track(result.getTempFile(), this); } return result; }
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
new DiskFileItemFactory(1048000, new File(System.getProperty("java.io.tmpdir"))); ServletFileUpload upload = new ServletFileUpload(factory); upload.setSizeMax(-1);
/** * Create a new {@link DiskFileItem} * instance from the supplied parameters and the local factory * configuration. * * @param fieldName The name of the form field. * @param contentType The content type of the form field. * @param isFormField <code>true</code> if this is a plain form field; * <code>false</code> otherwise. * @param fileName The name of the uploaded file, if any, as supplied * by the browser or other client. * * @return The newly created file item. */ @Override public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { DiskFileItem result = new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, repository); FileCleaningTracker tracker = getFileCleaningTracker(); if (tracker != null) { tracker.track(result.getTempFile(), this); } return result; }
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
public WebappContext(ServletContext servletContext, OpenOffice openOffice) { DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); fileUpload = new ServletFileUpload(fileItemFactory); if (openOffice.getFileSizeMax() != null) { fileUpload.setFileSizeMax(Integer.parseInt(openOffice.getFileSizeMax())); logger.info("max file upload size set to " + openOffice.getFileSizeMax()); } else { logger.warn("max file upload size not set"); } DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration(); if (openOffice.getPort() != null) { String ports = openOffice.getPort(); String[] portArr = ports.split(","); int[] portArrInt = new int[portArr.length]; int i = 0; for (String port : portArr){ portArrInt[i++] = Integer.parseInt(port); } configuration.setPortNumbers(portArrInt); } if (openOffice.getHome() != null) { configuration.setOfficeHome(new File(openOffice.getHome())); } if (StringUtils.isNotBlank(openOffice.getProfile())) { configuration.setTemplateProfileDir(new File(openOffice.getProfile())); } officeManager = configuration.buildOfficeManager(); documentConverter = new OfficeDocumentConverter(officeManager); }
/** * Create a new {@link DiskFileItem} * instance from the supplied parameters and the local factory * configuration. * * @param fieldName The name of the form field. * @param contentType The content type of the form field. * @param isFormField <code>true</code> if this is a plain form field; * <code>false</code> otherwise. * @param fileName The name of the uploaded file, if any, as supplied * by the browser or other client. * * @return The newly created file item. */ @Override public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { DiskFileItem result = new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, repository); FileCleaningTracker tracker = getFileCleaningTracker(); if (tracker != null) { tracker.track(result.getTempFile(), result); } return result; }
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { parameters.setParseFailedReason(FailReason.IO_ERROR); return; factory.setSizeThreshold(mce.getFileSizeThreshold());
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { partsParseException = ioe; return; factory.setSizeThreshold(mce.getFileSizeThreshold());
DiskFileItemFactory factory = new DiskFileItemFactory(); try { factory.setRepository(location.getCanonicalFile()); } catch (IOException ioe) { parameters.setParseFailedReason(FailReason.IO_ERROR); return; factory.setSizeThreshold(mce.getFileSizeThreshold());