ReadTemplates.java
Package ball.news; import java.io. *; import java.util. *;
Public class readTemplates {
Private string temp = null; private object a = new Object ();
Public ReadTemplates () {}
Public string gettlpcontent (string s) {if (temp == null) synchronized (a) {if (temp == null) Try {system.out.println ("-------------- -------------- "); TEMP = a (s); //system.out.println ("test the temp";} catch (exception e) {system. Out.println ("Get TLPConEnte Error" E.getMessage ());}} Return Temp;
private synchronized String a (String s) {String s1 = null; try {FileInputStream fileinputstream = new FileInputStream (s); int i = fileinputstream.available (); byte abyte0 [] = new byte [i]; fileinputstream.read (abyte0 ); Fileinputstream.close (); s1 = new string (abyte0);} catch (ioException e) {system.out.println ("ioException error" E.getMessage ());} Return S1;}
}