From: Julio G. <ju...@us...> - 2004-03-24 12:10:02
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8899/smartfrog/src/org/smartfrog/sfcore/parser Modified Files: SFParser.java Log Message: New helper methods to deploy and parse descriptions Index: SFParser.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/parser/SFParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SFParser.java 17 Mar 2004 15:01:30 -0000 1.2 --- SFParser.java 24 Mar 2004 11:59:26 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- import java.io.ByteArrayInputStream; import java.io.InputStream; + import java.io.IOException; import org.smartfrog.SFSystem; *************** *** 161,170 **** public Phases sfParseResource(String url) throws SmartFrogParseException { ! InputStream is = SFClassLoader.getResourceAsStream(url); ! if (is == null) { ! throw new SmartFrogParseException(MessageUtil.formatMessage( ! MSG_INPUTSTREAM_NULL)); } - return sfParse(is); } --- 162,190 ---- public Phases sfParseResource(String url) throws SmartFrogParseException { ! InputStream is=null; ! try { ! is = SFClassLoader.getResourceAsStream(url); ! if (is==null) { ! throw new SmartFrogParseException( ! MessageUtil.formatMessage(MSG_URL_TO_PARSE_NOT_FOUND,url)); ! // MessageUtil.formatMessage(MSG_INPUTSTREAM_NULL)+ ! // ". " + ! // MessageUtil.formatMessage(MSG_LOADING_URL,url)); ! } ! return sfParse(is); ! } catch (SmartFrogParseException spex){ ! throw spex; ! } catch (Throwable thr) { ! throw new SmartFrogParseException(MessageUtil. ! formatMessage(MSG_ERR_PARSE), thr); ! } finally { ! if (is!=null) { ! try { ! is.close(); ! } catch (IOException ignored) { ! //TODO ! } ! } } } |