code: public boolean writeTrustRoots(String directory) throws IOException {
          if (this.trustrootFilenames == null || this.trustrootData == null) {
              return false;
          }
          File rootDir = new File(directory);
          if (!rootDir.exists()) {
              rootDir.mkdirs();
          }
          for (int i = 0; i < trustrootFilenames.length; i++) {
              FileOutputStream out = new FileOutputStream(
                  directory + File.separator + this.trustrootFilenames[i]);
              out.write(this.trustrootData[i].getBytes());
              out.close();
          }
          return true;
      }
docs: Writes the retrieved trust roots to a trusted certificates directory.
  @param directory
  path where the trust roots should be written
  @return true if trust roots are written successfully, false if no
  trust roots are available to be written