Package org.apache.rat.annotation

Examples of org.apache.rat.annotation.AbstractLicenceAppender


      if (cl.hasOption('a')) {
        OutputStream reportOutput = new ByteArrayOutputStream();
        PrintStream stream = new PrintStream(reportOutput, true);
        report.report(stream);
       
        AbstractLicenceAppender  appender;
        String copyrightMsg = cl.getOptionValue("c");
        if ( copyrightMsg != null) {
          appender = new ApacheV2LicenceAppender(copyrightMsg);
        } else {
          appender = new ApacheV2LicenceAppender();
        }
        if (cl.hasOption("f")) {
          appender.setForce(true);
        }
       
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(false);
        ByteArrayInputStream xmlStream = new ByteArrayInputStream(reportOutput.toString().getBytes("UTF-8"));
        Document doc = factory.newDocumentBuilder().parse(xmlStream);
       
        NodeList resourceHeaders = doc.getElementsByTagName("header-type");
        String value = null;
        for (int i = 0; i < resourceHeaders.getLength(); i++) {
          Node headerType = resourceHeaders.item(i).getAttributes().getNamedItem("name");
          if(headerType != null) {
            value = headerType.getNodeValue();
          } else {
            value = null;
          }
          if (value != null &&value.equals("?????")) {
            Node resource = resourceHeaders.item(i).getParentNode();
            String filename = resource.getAttributes().getNamedItem("name").getNodeValue();
            File document = new File(filename);
            appender.append(document);
          }
        }
      }
     
      if (cl.hasOption('x')) {
View Full Code Here

TOP

Related Classes of org.apache.rat.annotation.AbstractLicenceAppender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.