예제 #1
0
 private void readCommentTemplates(InputStream stream) throws IOException, TeamException {
   try {
     SAXParserFactory factory = SAXParserFactory.newInstance();
     SAXParser parser = factory.newSAXParser();
     parser.parse(new InputSource(stream), new CommentTemplatesContentHandler());
   } catch (SAXException ex) {
     IStatus status =
         new CVSStatus(
             IStatus.ERROR,
             CVSStatus.ERROR,
             NLS.bind(
                 CVSUIMessages.RepositoryManager_parsingProblem,
                 new String[] {COMMENT_TEMPLATES_FILE}),
             ex);
     throw new CVSException(status);
   } catch (ParserConfigurationException ex) {
     IStatus status =
         new CVSStatus(
             IStatus.ERROR,
             CVSStatus.ERROR,
             NLS.bind(
                 CVSUIMessages.RepositoryManager_parsingProblem,
                 new String[] {COMMENT_TEMPLATES_FILE}),
             ex);
     throw new CVSException(status);
   }
 }
예제 #2
0
 private void readState(InputStream stream) throws IOException, TeamException {
   try {
     SAXParserFactory factory = SAXParserFactory.newInstance();
     SAXParser parser = factory.newSAXParser();
     parser.parse(new InputSource(stream), new RepositoriesViewContentHandler(this));
   } catch (SAXException ex) {
     IStatus status =
         new CVSStatus(
             IStatus.ERROR,
             CVSStatus.ERROR,
             NLS.bind(
                 CVSUIMessages.RepositoryManager_parsingProblem,
                 new String[] {REPOSITORIES_VIEW_FILE}),
             ex);
     throw new CVSException(status);
   } catch (ParserConfigurationException ex) {
     IStatus status =
         new CVSStatus(
             IStatus.ERROR,
             CVSStatus.ERROR,
             NLS.bind(
                 CVSUIMessages.RepositoryManager_parsingProblem,
                 new String[] {REPOSITORIES_VIEW_FILE}),
             ex);
     throw new CVSException(status);
   }
 }