Конец исходного...
Листинг 8.14. Конец исходного кода класса NewsFormatter (NewsFormatter.java)
private void setFromTemplate(String template ) throws IOException { File f = new File( newsFilePath, template );
FileReader fr = new FileReader( f );
BufferedReader br = new BufferedReader( fr );
StringBuffer hsb = new StringBuffer( 100 );
StringBuffer fsb = new StringBuffer( 100 );
String tmp = br.readLine();
// strips line terminators while( !tmp.startsWith("<!--INSERT" )){ hsb.append( tmp );
fsb.append("\r\n");
tmp = br.readLine();
} tmp = br.readLine();
while( tmp != null ){ fsb.append( tmp );
fsb.append("\r\n");
tmp = br.readLine();
} headStr = hsb.toString();
footStr = fsb.toString();
}
public String toString() { StringBuffer sb = new StringBuffer("NewsFormatter item ct= ");
sb.append( Integer.toString( itemNodes.length ));
return sb.toString() ; }
}
Содержание раздела