code: public synchronized boolean open(final boolean readOnly) {
  		if (isOpen()) {
  			close();
  		}
  		try {
  			raf = new RandomAccessFile(file, readOnly ? "r" : "rw");
  			fc = raf.getChannel();
  		} catch (Exception e) {
  			log.error("Exception in open()", e);
  			try {
  				close();
  			} catch (Exception ign) {
  			}
  		}
  		validState = isOpen();
  		return validState;
  	}
docs: Open file
  
  @param readOnly open in readOnly mode?
  @return true if valid state