Skip to content

Commit 9ca232d

Browse files
committed
Javadoc.
1 parent 3e273b0 commit 9ca232d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/file/PathUtils.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.nio.file.Files;
3131
import java.nio.file.LinkOption;
3232
import java.nio.file.NoSuchFileException;
33+
import java.nio.file.NotDirectoryException;
3334
import java.nio.file.OpenOption;
3435
import java.nio.file.Path;
3536
import java.nio.file.Paths;
@@ -732,7 +733,12 @@ public static boolean isEmpty(final Path path) throws IOException {
732733
*
733734
* @param directory the directory to query.
734735
* @return whether the directory is empty.
735-
* @throws IOException if an I/O error occurs.
736+
* @throws NotDirectoryException if the file could not otherwise be opened because it is not a directory
737+
* <i>(optional specific exception)</i>.
738+
* @throws IOException if an I/O error occurs.
739+
* @throws SecurityException In the case of the default provider, and a security manager is installed, the
740+
* {@link SecurityManager#checkRead(String) checkRead} method is invoked to check read
741+
* access to the directory.
736742
*/
737743
public static boolean isEmptyDirectory(final Path directory) throws IOException {
738744
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(directory)) {
@@ -745,7 +751,10 @@ public static boolean isEmptyDirectory(final Path directory) throws IOException
745751
*
746752
* @param file the file to query.
747753
* @return whether the file is empty.
748-
* @throws IOException if an I/O error occurs.
754+
* @throws IOException if an I/O error occurs.
755+
* @throws SecurityException In the case of the default provider, and a security manager is installed, its
756+
* {@link SecurityManager#checkRead(String) checkRead} method denies read access to the
757+
* file.
749758
*/
750759
public static boolean isEmptyFile(final Path file) throws IOException {
751760
return Files.size(file) <= 0;

0 commit comments

Comments
 (0)