Here you can find the source of asFileList(Object... paths)
public static List<File> asFileList(Object... paths)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static List<File> asFileList(Object... paths) { List<File> files = new ArrayList<File>(paths.length); for (Object it : paths) { if (it instanceof CharSequence) { files.add(new File(it.toString())); } else if (it instanceof File) { files.add((File) it); } else if (it instanceof Path) { files.add(((Path) it).toFile()); } else if (it instanceof Collection<?>) { files.addAll(asFileList(((Collection<?>) it).toArray())); // flatten object structure }// www.j ava 2 s. c o m } return files; } }