Remove throws IOException in method isSymlink()
* Remove throws IOException in method isSymlink()
The IOException is caught in 'Files.isSymbolicLink(Path path)' and therefore not thrown anymore in 'public static boolean isSymlink(final File file)'.
* Update FileUtils.java
Remove some not thrown IOExceptions
* Update FileUtils.java
Remove some not thrown IOExceptions
@@ -2683,16 +2683,12 @@ private static long sizeOfDirectory0(final File directory) {
long size = 0;
for (final File file : files) {
- try {
if (!isSymlink(file)) {
size += sizeOf0(file); // internal method
if (size < 0) {
break;
}
}
- } catch (final IOException ioe) {
- // Ignore exceptions caught when asking if a File is a symlink.
- }
}
return size;
@@ -2741,13 +2737,9 @@ private static BigInteger sizeOfDirectoryBig0(final File directory) {
BigInteger size = BigInteger.ZERO;
for (final File file : files) {
- try {
if (!isSymlink(file)) {
size = size.add(sizeOfBig0(file));
}
- } catch (final IOException ioe) {
- // Ignore exceptions caught when asking if a File is a symlink.
- }
}
return size;
@@ -3161,10 +3153,9 @@ private static void validateMoveParameters(final File src, final File dest) thro
* {@code boolean java.nio.file.Files.isSymbolicLink(Path path)}
* @param file the file to check
* @return true if the file is a Symbolic Link
- * @throws IOException if an IO error occurs while checking the file
* @since 2.0
*/
- public static boolean isSymlink(final File file) throws IOException {
+ public static boolean isSymlink(final File file) {
if (file == null) {
throw new NullPointerException("File must not be null");
}
