File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2936,7 +2936,7 @@ public static File toFile(final URL url) {
29362936 * @since 1.1
29372937 */
29382938 public static File [] toFiles (final URL ... urls ) {
2939- if (urls == null || urls .length == 0 ) {
2939+ if (IOUtils .length ( urls ) == 0 ) {
29402940 return EMPTY_FILE_ARRAY ;
29412941 }
29422942 final File [] files = new File [urls .length ];
Original file line number Diff line number Diff line change 1717
1818package org .apache .commons .io .file ;
1919
20+ import org .apache .commons .io .IOUtils ;
21+
2022/**
2123 * Defines the standard delete options.
2224 *
@@ -38,7 +40,7 @@ public enum StandardDeleteOption implements DeleteOption {
3840 * @return true if the given options contain {@link StandardDeleteOption#OVERRIDE_READ_ONLY}.
3941 */
4042 public static boolean overrideReadOnly (final DeleteOption [] options ) {
41- if (options == null || options .length == 0 ) {
43+ if (IOUtils .length ( options ) == 0 ) {
4244 return false ;
4345 }
4446 for (final DeleteOption deleteOption : options ) {
Original file line number Diff line number Diff line change 2525import java .nio .file .attribute .BasicFileAttributes ;
2626import java .util .stream .Stream ;
2727
28+ import org .apache .commons .io .IOUtils ;
29+
2830/**
2931 * This filter accepts files or directories that are empty.
3032 * <p>
@@ -101,7 +103,7 @@ protected EmptyFileFilter() {
101103 public boolean accept (final File file ) {
102104 if (file .isDirectory ()) {
103105 final File [] files = file .listFiles ();
104- return files == null || files .length == 0 ;
106+ return IOUtils .length ( files ) == 0 ;
105107 }
106108 return file .length () == 0 ;
107109 }
You can’t perform that action at this time.
0 commit comments