org.ow2.petals.microkernel.api.util
Class NioUtil

java.lang.Object
  extended by org.ow2.petals.microkernel.api.util.NioUtil

public final class NioUtil
extends Object

Author:
Rafael Marins - Fossil E-Commerce

Method Summary
static boolean checkAccess(File file)
          check if the file can be read
static void copyStreamToFile(InputStream is, File aFile)
          Transfer bytes blocks using direct buffer memory allocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copyStreamToFile

public static final void copyStreamToFile(InputStream is,
                                          File aFile)
                                   throws IOException
Transfer bytes blocks using direct buffer memory allocation. Relies in use the faster Java New I/O instead of traditional byte array move.

Parameters:
is - the InputStream to copy
aFile - the output File
Throws:
IOException - if errors occured

checkAccess

public static final boolean checkAccess(File file)
check if the file can be read

Parameters:
file -
Returns:
true if the file is not locked, false otherwise


Copyright © 2005-2015 Linagora. All Rights Reserved.