question: public int write ( final Protein protein ) throws IOException { checkEntryHierarchy ( ) ; if ( entryHierarchy != null ) { for ( ProteinXref xref : protein . getCrossReferences ( ) ) { final SimpleProtein simpleProtein = SimpleProtein . valueOf ( protein , xref , entryHierarchy ) ; if ( simpleProtein != null ) { final SimpleHash model = buildModelMap ( simpleProtein , entryHierarchy ) ; Writer writer = null ; try { final Template temp = freeMarkerConfig . getTemplate ( freeMarkerTemplate ) ; checkTempDirectory ( tempDirectory ) ; if ( ! tempDirectory . endsWith ( File . separator ) ) { tempDirectory = tempDirectory + File . separator ; } UrlFriendlyIdGenerator gen = UrlFriendlyIdGenerator . getInstance ( ) ; String urlFriendlyId = gen . generate ( xref . getIdentifier ( ) ) ; final Path newResultFile = Paths . get ( tempDirectory + urlFriendlyId + ".svg" ) ; resultFiles . add ( newResultFile ) ; writer = Files . newBufferedWriter ( newResultFile , characterSet ) ; temp . process ( model , writer ) ; writer . flush ( ) ; } catch ( TemplateException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { if ( writer != null ) { writer . close ( ) ; } } } } } return 0 ; }
target:  Writes out protein view to an zipped and compressed HTML file.