private final String getNotOverridableContent ( ) throws IOException { if ( Files . exists ( filePath ) ) { List < String > lines = Files . readAllLines ( filePath , fileType . getEncoding ( ) ) ; boolean isNotOverridable = false ; StringWriter notOverridableContentWriter = new StringWriter ( ) ; for ( String line : lines ) { if ( line . contains ( fileType . getSpecificCodeStartMark ( ) ) ) { isNotOverridable = true ; } else if ( line . contains ( fileType . getSpecificCodeEndMark ( ) ) ) { isNotOverridable = false ; } else { if ( isNotOverridable ) { notOverridableContentWriter . append ( line + SKIP_LINE ) ; } } } return notOverridableContentWriter . toString ( ) ; } return "" ; }
extract non generated content from a file to keep it after next generation