private IoChannel getFileChannel ( String fileName ) throws IOException { synchronized ( prepareAnchor ( fileName ) ) { IoChannel fileChannel = openFiles . get ( fileName ) ; if ( fileChannel == null ) { File dbFile = fileName . equals ( DEFAULT_LOG_FILE ) ? new File ( logDirectory , fileName ) : new File ( dbDirectory , fileName ) ; fileChannel = IoAllocator . newIoChannel ( dbFile ) ; openFiles . put ( fileName , fileChannel ) ; } return fileChannel ; } }
Returns the file channel for the specified filename . The file channel is stored in a map keyed on the filename . If the file is not open then it is opened and the file channel is added to the map .