Does Java NIO require special permissions for Windows?
When I run the following Java code on Windows Server 2003, it fails with a "denied access" error (which is the whole message in the cygwin terminal window):
new FileOutputStream(outputFile).getChannel() .transferFrom(new FileInputStream(inputFile).getChannel(), 0, Long.MAX_VALUE);
but if I use Apache commons-io (which I suppose DOES NOT use NIO, it works with the same input and output files:
final FileInputStream inputStream = new FileInputStream(inputFile) final FileOutputStream outputStream = new FileOutputStream(outputStream) IOUtils.copy(inputStream, outputStream);
I am working on Java 5 with an administrator account. Is there any special permission for the file that needs to be installed?
Ralph
source share