List of usage examples for org.apache.commons.io FileCleaner track
public static void track(String path, Object marker)
From source file:com.mob.forum.util.legacy.commons.fileupload.disk.DiskFileItem.java
/** * Creates and returns a {@link java.io.File File} representing a uniquely * named temporary file in the configured repository path. The lifetime of * the file is tied to the lifetime of the <code>FileItem</code> instance; * the file will be deleted when the instance is garbage collected. * * @return The {@link java.io.File File} to be used for temporary storage. *///from w ww.j av a 2s . c om protected File getTempFile() { File tempDir = repository; if (tempDir == null) { tempDir = new File(System.getProperty("java.io.tmpdir")); } String fileName = "upload_" + getUniqueId() + ".tmp"; File f = new File(tempDir, fileName); FileCleaner.track(f, this); return f; }