@@ -235,8 +235,8 @@ public static void touch(File file) throws IOException {
235235 * @param files a Collection containing java.io.File instances
236236 * @return an array of java.io.File
237237 */
238- public static File [] convertFileCollectionToFileArray (Collection files ) {
239- return ( File []) files .toArray (new File [files .size ()]);
238+ public static File [] convertFileCollectionToFileArray (Collection < File > files ) {
239+ return files .toArray (new File [files .size ()]);
240240 }
241241
242242 //-----------------------------------------------------------------------
@@ -248,7 +248,7 @@ public static File[] convertFileCollectionToFileArray(Collection files) {
248248 * @param directory the directory to search in.
249249 * @param filter the filter to apply to files and directories.
250250 */
251- private static void innerListFiles (Collection files , File directory ,
251+ private static void innerListFiles (Collection < File > files , File directory ,
252252 IOFileFilter filter ) {
253253 File [] found = directory .listFiles ((FileFilter ) filter );
254254 if (found != null ) {
@@ -287,7 +287,7 @@ private static void innerListFiles(Collection files, File directory,
287287 * @see org.apache.commons.io.filefilter.FileFilterUtils
288288 * @see org.apache.commons.io.filefilter.NameFileFilter
289289 */
290- public static Collection listFiles (
290+ public static Collection < File > listFiles (
291291 File directory , IOFileFilter fileFilter , IOFileFilter dirFilter ) {
292292 if (!directory .isDirectory ()) {
293293 throw new IllegalArgumentException (
@@ -311,7 +311,7 @@ public static Collection listFiles(
311311 }
312312
313313 //Find files
314- Collection files = new java .util .LinkedList ();
314+ Collection < File > files = new java .util .LinkedList < File > ();
315315 innerListFiles (files , directory ,
316316 FileFilterUtils .orFileFilter (effFileFilter , effDirFilter ));
317317 return files ;
@@ -873,11 +873,11 @@ public static void copyDirectory(File srcDir, File destDir,
873873 }
874874
875875 // Cater for destination being directory within the source directory (see IO-141)
876- List exclusionList = null ;
876+ List < String > exclusionList = null ;
877877 if (destDir .getCanonicalPath ().startsWith (srcDir .getCanonicalPath ())) {
878878 File [] srcFiles = filter == null ? srcDir .listFiles () : srcDir .listFiles (filter );
879879 if (srcFiles != null && srcFiles .length > 0 ) {
880- exclusionList = new ArrayList (srcFiles .length );
880+ exclusionList = new ArrayList < String > (srcFiles .length );
881881 for (int i = 0 ; i < srcFiles .length ; i ++) {
882882 File copiedFile = new File (destDir , srcFiles [i ].getName ());
883883 exclusionList .add (copiedFile .getCanonicalPath ());
@@ -899,7 +899,7 @@ public static void copyDirectory(File srcDir, File destDir,
899899 * @since Commons IO 1.1
900900 */
901901 private static void doCopyDirectory (File srcDir , File destDir , FileFilter filter ,
902- boolean preserveFileDate , List exclusionList ) throws IOException {
902+ boolean preserveFileDate , List < String > exclusionList ) throws IOException {
903903 if (destDir .exists ()) {
904904 if (destDir .isDirectory () == false ) {
905905 throw new IOException ("Destination '" + destDir + "' exists but is not a directory" );
0 commit comments