Package com.puppetlabs.geppetto.common.os.StreamUtil

Examples of com.puppetlabs.geppetto.common.os.StreamUtil.OpenBAStream


    IFile mdjson = moduleFile.getParent().getFile(Path.fromPortableString(METADATA_JSON_NAME));
    if(mdjson.exists())
      return;

    try {
      OpenBAStream oba = new OpenBAStream();
      PrintStream ps = new PrintStream(oba);
      ps.println("{}");
      ps.close();
      mdjson.create(oba.getInputStream(), IResource.DERIVED, monitor);
    }
    catch(CoreException e) {
    }
  }
View Full Code Here


  @Override
  public String getVersion() throws IOException {
    // Verify that puppet-lint is installed. If not, then refuse to install this bundle

    OpenBAStream out = new OpenBAStream();
    OpenBAStream err = new OpenBAStream();
    File home = new File(System.getProperty("user.home"));
    int exitCode = OsUtil.runProcess(home, out, err, getPuppetLintExecutable(), "--version");
    String outStr = out.toString(Charset.defaultCharset());
    if(exitCode != 0) {
      StringBuilder bld = new StringBuilder();
      bld.append("Got exit code ");
      bld.append(exitCode);
      bld.append(" when running puppet-lint.");
      outStr = outStr.trim();
      if(!outStr.isEmpty()) {
        bld.append(" Output \"");
        bld.append(outStr);
        bld.append('"');
      }

      String errStr = err.toString(Charset.defaultCharset()).trim();
      if(!errStr.isEmpty()) {
        bld.append(" Errors \"");
        bld.append(errStr);
        bld.append('"');
      }
View Full Code Here

    params.add("%{KIND} %{check} #%{path}#:%{linenumber} %{message}");
    for(Option option : options)
      params.add("--" + option);
    params.add(pathToCheck);

    OpenBAStream out = new OpenBAStream();
    OpenBAStream err = new OpenBAStream();
    OsUtil.runProcess(fileOrDirectory, out, err, params.toArray(new String[params.size()]));
    List<Issue> issues = new ArrayList<Issue>();
    Matcher m = issuePattern.matcher(out.toString(Charset.defaultCharset()));
    while(m.find()) {
      String path = m.group(3);
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.common.os.StreamUtil.OpenBAStream

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.