Allocate disk space for multiple file downloads in Java
问题 Is there any way of reliably "allocating" (reserving) hard disk space via "standard" Java (J2SE 5 or later)? Take for example the case of a multithreaded application, executing in a thread pool, where every thread downloads files. How can the application make sure that its download won't be interrupted as a result of disk space exhaustion? At least, if it knows beforehand the size of the file it is downloading, can it do some sort of "reservation", which would guarantee file download,