This is quite platform specific, and any solution might involve platform specific code. My one suggestion would be to look at the java 7 API within the java.nio packages. For example the following...