List of usage examples for org.apache.wicket.util.file Files writeTo
public static int writeTo(final java.io.File file, final InputStream input, final int bufSize) throws IOException
From source file:au.org.theark.core.util.LoadCsvFileHelper.java
License:Open Source License
/** * Saves this file upload to a given file on the server side. * //from w w w . ja v a2s. c om * @param inputStream * The input stream * @throws IOException */ public void writeToTempFile(final InputStream inputStream) throws IOException { log.info("Writing to temp file: " + temporaryFileName + ".tmp"); File file = File.createTempFile(temporaryFileName, null); int bufSize = 4096; InputStream is = inputStream; try { Files.writeTo(file, is, bufSize); } finally { is.close(); } }