@@ -204,31 +204,31 @@ default T channels(String... channels) {
204204 T channels (List <String > channels );
205205
206206 /**
207- * Specifies a configuration file to build from.
207+ * Specifies a configuration file path to build from.
208208 * Reads the file content immediately and delegates to {@link #content(String)}.
209209 *
210- * @param file Configuration file (e.g., pixi.toml, environment.yml)
210+ * @param path Path to configuration file (e.g., " pixi.toml", " environment.yml" )
211211 * @return This builder instance, for fluent-style programming.
212- * @throws BuildException If the file cannot be read
212+ * @throws BuildException If the file cannot be read or is invalid
213213 */
214- default T file (File file ) throws BuildException {
215- return file (file . getAbsolutePath ( ));
214+ default T file (String path ) throws BuildException {
215+ return file (new File ( path ));
216216 }
217217
218218 /**
219- * Specifies a configuration file path to build from.
219+ * Specifies a configuration file to build from.
220220 * Reads the file content immediately and delegates to {@link #content(String)}.
221221 *
222- * @param path Path to configuration file (e.g., " pixi.toml", " environment.yml" )
222+ * @param file Configuration file (e.g., pixi.toml, environment.yml)
223223 * @return This builder instance, for fluent-style programming.
224- * @throws BuildException If the file cannot be read or is invalid
224+ * @throws BuildException If the file cannot be read
225225 */
226- default T file (String path ) throws BuildException {
226+ default T file (File file ) throws BuildException {
227227 try {
228- Path filePath = Paths . get ( path );
228+ Path filePath = file . toPath ( );
229229 String fileContent = new String (
230- Files .readAllBytes (filePath ),
231- StandardCharsets .UTF_8
230+ Files .readAllBytes (filePath ),
231+ StandardCharsets .UTF_8
232232 );
233233 return content (fileContent );
234234 }
@@ -237,6 +237,23 @@ default T file(String path) throws BuildException {
237237 }
238238 }
239239
240+ /**
241+ * Specifies a URL to fetch configuration content from.
242+ * Reads the URL content immediately and delegates to {@link #content(String)}.
243+ *
244+ * @param path URL path of configuration file
245+ * @return This builder instance, for fluent-style programming.
246+ * @throws BuildException If the URL cannot be read or is invalid
247+ */
248+ default T url (String path ) throws BuildException {
249+ try {
250+ return url (new URL (path ));
251+ }
252+ catch (MalformedURLException e ) {
253+ throw new BuildException (this , e );
254+ }
255+ }
256+
240257 /**
241258 * Specifies a URL to fetch configuration content from.
242259 * Reads the URL content immediately and delegates to {@link #content(String)}.
@@ -260,23 +277,6 @@ default T url(URL url) throws BuildException {
260277 }
261278 }
262279
263- /**
264- * Specifies a URL to fetch configuration content from.
265- * Reads the URL content immediately and delegates to {@link #content(String)}.
266- *
267- * @param path URL path of configuration file
268- * @return This builder instance, for fluent-style programming.
269- * @throws BuildException If the URL cannot be read or is invalid
270- */
271- default T url (String path ) throws BuildException {
272- try {
273- return url (new URL (path ));
274- }
275- catch (MalformedURLException e ) {
276- throw new BuildException (this , e );
277- }
278- }
279-
280280 /**
281281 * Specifies configuration file content to build from.
282282 * The scheme will be auto-detected from content syntax.
0 commit comments