@SuppressWarnings({"HardCodedStringLiteral"}) public File generate() throws IOException {
  File scriptPath=FileUtil.createTempFile(myPrefix,SCRIPT_EXT);
  scriptPath.deleteOnExit();
  PrintWriter out=new PrintWriter(new FileWriter(scriptPath));
  try {
    if (SystemInfo.isWindows) {
      out.println("@echo off");
    }
 else {
      out.println("#!/bin/sh");
    }
    String line=commandLine();
    if (SystemInfo.isWindows) {
      line+=" %*";
    }
 else {
      line+=" \"$@\"";
    }
    out.println(line);
  }
  finally {
    out.close();
  }
  FileUtil.setExecutableAttribute(scriptPath.getPath(),true);
  return scriptPath;
}

@ SuppressWarnings ( { "HardCodedStringLiteral" } ) public File generate ( ) throws IOException { File scriptPath = FileUtil . createTempFile ( myPrefix , SCRIPT_EXT ) ; scriptPath . deleteOnExit ( ) ; PrintWriter out = new PrintWriter ( new FileWriter ( scriptPath ) ) ; try { if ( SystemInfo . isWindows ) { out . println ( "@echo off" ) ; } else { out . println ( "#!/bin/sh" ) ; } String line = commandLine ( ) ; if ( SystemInfo . isWindows ) { line += " %*" ; } else { line += " \"$@\"" ; } out . println ( line ) ; } finally { out . close ( ) ; } FileUtil . setExecutableAttribute ( scriptPath . getPath ( ) , true ) ; return scriptPath ; }
generate script according to specified parameters
