@@ -51,27 +51,30 @@ protected ClasspathBuilder(List<URL> urls) {
5151 }
5252
5353 /**
54- * Builds a classpath string or an argument file representing the classpath, depending
55- * on the operating system.
56- * @param urls an array of {@link URL} representing the elements of the classpath
57- * @return the classpath; on Windows, the path to an argument file is returned,
58- * prefixed with '@'
54+ * Creates a ClasspathBuilder instance using the specified list of URLs.
55+ * @param urls a list of {@link URL} objects representing the elements of the
56+ * classpath
57+ * @return a new instance of {@code ClasspathBuilder}
5958 */
6059 static ClasspathBuilder forURLs (List <URL > urls ) {
6160 return new ClasspathBuilder (new ArrayList <>(urls ));
6261 }
6362
6463 /**
65- * Builds a classpath string or an argument file representing the classpath, depending
66- * on the operating system.
67- * @param urls an array of {@link URL} representing the elements of the classpath
68- * @return the classpath; on Windows, the path to an argument file is returned,
69- * prefixed with '@'
64+ * Creates a ClasspathBuilder instance using the specified array of URLs.
65+ * @param urls an array of {@link URL} objects representing the elements of the
66+ * classpath
67+ * @return a new instance of {@code ClasspathBuilder}
7068 */
7169 static ClasspathBuilder forURLs (URL ... urls ) {
7270 return new ClasspathBuilder (Arrays .asList (urls ));
7371 }
7472
73+ /**
74+ * Builds {@link Classpath} that containing a classpath argument and its corresponding
75+ * classpath elements.
76+ * @return a {@code Classpath}
77+ */
7578 Classpath build () {
7679 if (ObjectUtils .isEmpty (this .urls )) {
7780 return new Classpath ("" , Collections .emptyList ());
@@ -88,6 +91,13 @@ Classpath build() {
8891 return new Classpath (argument , files );
8992 }
9093
94+ /**
95+ * Determines if an argument file should be used for the classpath based on the
96+ * operating system. On Windows, argument files are used due to the command length
97+ * limitation.
98+ * @return {@code true} if an argument file is required for the classpath,
99+ * {@code false} otherwise
100+ */
91101 protected boolean needsClasspathArgFile () {
92102 String os = System .getProperty ("os.name" );
93103 if (!StringUtils .hasText (os )) {
@@ -145,6 +155,9 @@ private static Path toFile(URL url) {
145155 }
146156 }
147157
158+ /**
159+ * Classpath consisting of a {@code -cp} argument and its associated elements.
160+ */
148161 static final class Classpath {
149162
150163 private final String argument ;
@@ -157,7 +170,8 @@ private Classpath(String argument, List<Path> elements) {
157170 }
158171
159172 /**
160- * Return the {@code -cp} argument value.
173+ * Return the {@code -cp} argument value; on Windows, the path to an argument file
174+ * is returned, prefixed with '@'.
161175 * @return the argument to use
162176 */
163177 String argument () {
0 commit comments