1
1
/*
2
- * Copyright (c) 2016, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2016, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -233,6 +233,17 @@ public static OutputAnalyzer kinit(String args) throws Exception {
233
233
return execute (getProcessBuilder ("kinit" , makeList (args )));
234
234
}
235
235
236
+ /**
237
+ * Runs jar.
238
+ *
239
+ * @param args arguments to jar in the list.
240
+ * @return an {@link OutputAnalyzer} object
241
+ * @throws Exception if there is an error
242
+ */
243
+ public static OutputAnalyzer jar (final List <String > args ) throws Exception {
244
+ return execute (getProcessBuilder ("jar" , args ));
245
+ }
246
+
236
247
/**
237
248
* Runs jar.
238
249
*
@@ -241,8 +252,20 @@ public static OutputAnalyzer kinit(String args) throws Exception {
241
252
* @return an {@link OutputAnalyzer} object
242
253
* @throws Exception if there is an error
243
254
*/
244
- public static OutputAnalyzer jar (String args ) throws Exception {
245
- return execute (getProcessBuilder ("jar" , makeList (args )));
255
+ public static OutputAnalyzer jar (final String args ) throws Exception {
256
+ return jar (makeList (args ));
257
+ }
258
+
259
+ /**
260
+ * Runs jar.
261
+ *
262
+ * @param args arguments to jar in multiple strings.
263
+ * Converted to be a List with List.of.
264
+ * @return an {@link OutputAnalyzer} object
265
+ * @throws Exception if there is an error
266
+ */
267
+ public static OutputAnalyzer jar (final String ... args ) throws Exception {
268
+ return jar (List .of (args ));
246
269
}
247
270
248
271
/**
0 commit comments