Virtual disk space reservation in java-Collection of common programming errors

Assume a multithreaded application scenario, in which every thread acquires some data (one or more files) from the network, performs some processing and then saves the results on the hard disk of the hosting machine.

In such a scenario, there is always the possibility that the disk space is exhausted, leading to unexpected service behavior (e.g., a system crash).

To avoid a case like that, it would be helpful if Java provided a means of reserving hard disk space, but, as verified in an earlier question, such an option is not available and even if it were, it could lead to inefficient allocation (e.g., in the case of a decompressing application, which does not know beforehand the total size of the decompressed data).

So, an alternative could be to make “virtual disk space reservations”, e.g. by keeping in memory a static registry of the free space and having each thread request capacity from the registry before proceeding.

Are there any better alternatives, or improvements to this approach?

Is there any (preferably open source) Java library that implements such functionality?