void setFinal ( boolean isFinal ) throws IOException { if ( isFinal != m_isFinal ) { if ( PBDSegment . setFinal ( m_file , isFinal ) ) { if ( ! isFinal ) { // It is dangerous to leave final on a segment so make sure the metadata is flushed m_fc . force ( true ) ; } } else if ( PBDSegment . isFinal ( m_file ) && ! isFinal ) { throw new IOException ( "Could not remove the final attribute from " + m_file . getName ( ) ) ; } // It is OK for m_isFinal to be true when isFinal(File) returns false but not the other way m_isFinal = isFinal ; } }
Set or clear segment as final i . e . whether segment is complete and logically immutable .