static AsynchronousFileChannel newAsynchronousFileChannel(String pathForWindows,String pathToCheck,Set<? extends OpenOption> options,long pSecurityDescriptor,ThreadPool pool) throws IOException {
  Flags flags=Flags.toFlags(options);
  flags.overlapped=true;
  if (!flags.read && !flags.write) {
    flags.read=true;
  }
  if (flags.append)   throw new UnsupportedOperationException("APPEND not allowed");
  FileDescriptor fdObj;
  try {
    fdObj=open(pathForWindows,pathToCheck,flags,pSecurityDescriptor);
  }
 catch (  WindowsException x) {
    x.rethrowAsIOException(pathForWindows);
    return null;
  }
  try {
    return WindowsAsynchronousFileChannelImpl.open(fdObj,flags.read,flags.write,pool);
  }
 catch (  IOException x) {
    long handle=fdAccess.getHandle(fdObj);
    CloseHandle(handle);
    throw x;
  }
}

static AsynchronousFileChannel newAsynchronousFileChannel ( String pathForWindows , String pathToCheck , Set < ? extends OpenOption > options , long pSecurityDescriptor , ThreadPool pool ) throws IOException { Flags flags = Flags . toFlags ( options ) ; flags . overlapped = true ; if ( ! flags . read && ! flags . write ) { flags . read = true ; } if ( flags . append ) throw new UnsupportedOperationException ( "APPEND not allowed" ) ; FileDescriptor fdObj ; try { fdObj = open ( pathForWindows , pathToCheck , flags , pSecurityDescriptor ) ; } catch ( WindowsException x ) { x . rethrowAsIOException ( pathForWindows ) ; return null ; } try { return WindowsAsynchronousFileChannelImpl . open ( fdObj , flags . read , flags . write , pool ) ; } catch ( IOException x ) { long handle = fdAccess . getHandle ( fdObj ) ; CloseHandle ( handle ) ; throw x ; } }
open / creates file , returning asynchronousfilechannel to access the file
