コード例 #1
0
  public boolean run(Collection<SubversionSCM.External> externals, Result changeLog)
      throws IOException, InterruptedException {
    boolean changelogFileCreated = false;

    final SVNClientManager manager = SubversionSCM.createSvnClientManager();
    try {
      SVNLogClient svnlc = manager.getLogClient();
      TransformerHandler th = createTransformerHandler();
      th.setResult(changeLog);
      SVNXMLLogHandler logHandler = new SVNXMLLogHandler(th);
      // work around for http://svnkit.com/tracker/view.php?id=175
      th.setDocumentLocator(DUMMY_LOCATOR);
      logHandler.startDocument();

      for (ModuleLocation l : scm.getLocations(build)) {
        changelogFileCreated |= buildModule(l.getURL(), svnlc, logHandler);
      }
      for (SubversionSCM.External ext : externals) {
        changelogFileCreated |=
            buildModule(getUrlForPath(build.getWorkspace().child(ext.path)), svnlc, logHandler);
      }

      if (changelogFileCreated) {
        logHandler.endDocument();
      }

      return changelogFileCreated;
    } finally {
      manager.dispose();
    }
  }
コード例 #2
0
    public State(UnmarshallingContext context) throws SAXException {
      result = dom.createUnmarshaller(context);

      handler.setResult(result);

      // emulate the start of documents
      try {
        handler.setDocumentLocator(context.getLocator());
        handler.startDocument();
        declarePrefixes(context, context.getAllDeclaredPrefixes());
      } catch (SAXException e) {
        context.handleError(e);
        throw e;
      }
    }