Skip to content

Commit c1f066e

Browse files
author
Brian Burkhalter
committed
8356888: (fs) FileSystems.newFileSystem that take an env must specify IllegalArgumentException
Reviewed-by: lancea, alanb, jpai
1 parent c295377 commit c1f066e

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/java.base/share/classes/java/nio/file/FileSystems.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -257,8 +257,9 @@ public static FileSystem getFileSystem(URI uri) {
257257
*
258258
* @throws IllegalArgumentException
259259
* if the pre-conditions for the {@code uri} parameter are not met,
260-
* or the {@code env} parameter does not contain properties required
261-
* by the provider, or a property value is invalid
260+
* or if the {@code env} parameter does not contain properties
261+
* required by the provider, contains an invalid combination of
262+
* properties and values, or contains an invalid property value
262263
* @throws FileSystemAlreadyExistsException
263264
* if the file system has already been created
264265
* @throws ProviderNotFoundException
@@ -296,8 +297,9 @@ public static FileSystem newFileSystem(URI uri, Map<String,?> env)
296297
*
297298
* @throws IllegalArgumentException
298299
* if the pre-conditions for the {@code uri} parameter are not met,
299-
* or the {@code env} parameter does not contain properties required
300-
* by the provider, or a property value is invalid
300+
* or if the {@code env} parameter does not contain properties
301+
* required by the provider, contains an invalid combination of
302+
* properties and values, or contains an invalid property value
301303
* @throws FileSystemAlreadyExistsException
302304
* if the URI scheme identifies an installed provider and the file
303305
* system has already been created
@@ -370,6 +372,8 @@ public static FileSystem newFileSystem(URI uri, Map<String,?> env, ClassLoader l
370372
* when an error occurs while loading a service provider
371373
* @throws IOException
372374
* if an I/O error occurs
375+
*
376+
* @since 13
373377
*/
374378
public static FileSystem newFileSystem(Path path,
375379
ClassLoader loader)
@@ -400,6 +404,10 @@ public static FileSystem newFileSystem(Path path,
400404
*
401405
* @return a new file system
402406
*
407+
* @throws IllegalArgumentException
408+
* if the {@code env} parameter does not contain properties
409+
* required by the provider, contains an invalid combination of
410+
* properties and values, or contains an invalid property value
403411
* @throws ProviderNotFoundException
404412
* if a provider supporting this file type cannot be located
405413
* @throws ServiceConfigurationError
@@ -476,6 +484,10 @@ public static FileSystem newFileSystem(Path path) throws IOException {
476484
*
477485
* @return a new file system
478486
*
487+
* @throws IllegalArgumentException
488+
* if the {@code env} parameter does not contain properties
489+
* required by the provider, contains an invalid combination of
490+
* properties and values, or contains an invalid property value
479491
* @throws ProviderNotFoundException
480492
* if a provider supporting this file type cannot be located
481493
* @throws ServiceConfigurationError

0 commit comments

Comments
 (0)