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;
	}
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 ; }
Open file

@param readOnly open in readOnly mode?
@return true if valid state