equal
deleted
inserted
replaced
75 args.add("-p"); |
75 args.add("-p"); |
76 |
76 |
77 try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
77 try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
78 PrintStream ps = new PrintStream(baos)) { |
78 PrintStream ps = new PrintStream(baos)) { |
79 ProcessBuilder security = new ProcessBuilder(args); |
79 ProcessBuilder security = new ProcessBuilder(args); |
80 IOUtils.exec(security, verbose, false, ps); |
80 IOUtils.exec(security, false, ps); |
81 |
81 |
82 File output = File.createTempFile("tempfile", ".tmp"); |
82 File output = File.createTempFile("tempfile", ".tmp"); |
83 |
83 |
84 Files.copy(new ByteArrayInputStream(baos.toByteArray()), |
84 Files.copy(new ByteArrayInputStream(baos.toByteArray()), |
85 output.toPath(), StandardCopyOption.REPLACE_EXISTING); |
85 output.toPath(), StandardCopyOption.REPLACE_EXISTING); |
103 args.add(filename); |
103 args.add(filename); |
104 |
104 |
105 try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
105 try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
106 PrintStream ps = new PrintStream(baos)) { |
106 PrintStream ps = new PrintStream(baos)) { |
107 ProcessBuilder security = new ProcessBuilder(args); |
107 ProcessBuilder security = new ProcessBuilder(args); |
108 IOUtils.exec(security, verbose, false, ps); |
108 IOUtils.exec(security, false, ps); |
109 String output = baos.toString(); |
109 String output = baos.toString(); |
110 output = output.substring(output.indexOf("=") + 1); |
110 output = output.substring(output.indexOf("=") + 1); |
111 DateFormat df = new SimpleDateFormat( |
111 DateFormat df = new SimpleDateFormat( |
112 "MMM dd kk:mm:ss yyyy z", Locale.ENGLISH); |
112 "MMM dd kk:mm:ss yyyy z", Locale.ENGLISH); |
113 result = df.parse(output); |
113 result = df.parse(output); |