code: public boolean open(final boolean readOnly) {
  		if (isOpen()) {
  			close();
  		}
  		if (log.isDebugEnabled()) {
  			log.debug("open(" + file + ")");
  		}
  		try {
  			raf = new RandomAccessFile(file, readOnly ? "r" : "rw");
  			fileChannel = raf.getChannel();
  			if (useLock) {
  				lock(readOnly);
  			}
  		} catch (Exception e) {
  			log.error("Exception in open()", e);
  			try {
  				unlock();
  			} catch (Exception ign) {
  			}
  			try {
  				fileChannel.close();
  			} catch (Exception ign) {
  			}
  			try {
  				raf.close();
  			} catch (Exception ign) {
  			}
  			raf = null;
  			fileChannel = null;
  		}
  		validState = isOpen();
  		return validState;
  	}
docs: Open file
  
  @param readOnly open for readOnly?
  @return true if valid state