org.apache.sanselan.util.IOUtils Java Examples

The following examples show how to use org.apache.sanselan.util.IOUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThriftCompilerConfigurable.java    From intellij-thrift with Apache License 2.0 6 votes vote down vote up
public String readVersion() {
  // check file version
  try {
    Process process = new ProcessBuilder(thriftCmd, "--version").start();
    process.waitFor();

    byte[] stdOut;
    InputStream stdOutIS = process.getInputStream();
    try {
      stdOut = IOUtils.getInputStreamBytes(stdOutIS);
      if (stdOut == null || stdOut.length == 0) {
        return null;
      }
    }
    finally {
      stdOutIS.close();
    }

    return new String(stdOut);
  }
  catch (Exception e1) {
    // Ignore
  }

  return null;
}