增加文件资源

@param files 文件资源
@return this
963037
public MultiFileResource add(File... files) {
		for (File file : files) {
			this.add(new FileResource(file));
		}
		return this;
	}
915687
public void expandClasspath(File... files) {
        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        Class<URLClassLoader> urlClass = URLClassLoader.class;
        for (File file: files) {
            LOGGER.info("Expanding classpath to include: " + file.getAbsolutePath());
            URI fileUri = file.toURI();
            try {
                Method method = urlClass.getDeclaredMethod("addURL", URL.class);
                method.setAccessible(true);
                method.invoke(classLoader, fileUri.toURL());
            } catch (MalformedURLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
                LOGGER.error("Error expanding classpath", e);
            }
        }
    }
1166670
public void addFile(ISO9660File file) {
        file.setParentDirectory(this);
        files.add(file);
        sorted = false;
    }
572547
public ThreadContextClassLoaderBuilder addPaths(final List<String> paths) {

        // Check sanity
        Validate.notNull(paths, "paths");

        // Delegate
        for (String path : paths) {
            addPath(path);
        }

        return this;
    }
1019267
public static void addFile(State state, String file) {
    state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
  }
1363976
public OperaOptions addExtensions(List<File> paths) {
    for (File path : paths) {
      checkNotNull(path);
      checkArgument(path.exists(), "%s does not exist", path.getAbsolutePath());
      checkArgument(!path.isDirectory(), "%s is a directory",
          path.getAbsolutePath());
    }
    extensionFiles.addAll(paths);
    return this;
  }
408645
public function setFiles(array $files) {
        if(!$this->setModified('files', $files)->isModified()) {
            return $this;
        }
		$this->files = $files;
		return $this;
    }
627868
public function addFiles(FileInterface $file)
    {
        if ($this->files === null) {
            $this->files = new ArrayCollection();
        }

        $this->files[] = $file;

        return $this;
    }
1334695
private List<File> asFiles(File srcDir, String[] files, FileNameMapper m) {
    List<File> newFiles = new ArrayList<>();
    for(String file : files) {
      boolean hasMatchingExtension = m.mapFileName(file) != null; //use mapFileName as a check to validate if the source file extension is recognized by the mapper or not
      if(hasMatchingExtension) {
        newFiles.add(new File(srcDir, file));
      }
    }
    return newFiles;
  }
857857
public static File addExtension(final File f, final String extension) {
    checkNotNull(f);
    checkNotNull(extension);
    Preconditions.checkArgument(!extension.isEmpty());
    Preconditions.checkArgument(!f.isDirectory());

    final String absolutePath = f.getAbsolutePath();
    return new File(absolutePath + "." + extension);
  }
839211
public static File addFileExtension(File file, String extension) {
		return new File(file.getAbsolutePath() + "." + extension);
	}
845459
public void doOpenFile(File[] files)
	{
	    if (files!=null)
	    {
	    	if (files.length==1)
	    	{
	    		File f = files[0];
		    	if (f.isFile())
		    	{
			    	String modFileName = f.getAbsolutePath();
			    	int i = modFileName.lastIndexOf(File.separatorChar);
			    	searchPath = modFileName.substring(0, i);
		    		loadMultimediaOrPlayListFile(Helpers.createURLfromFile(f)); 
		    	}
		    	else
		    	if (f.isDirectory())
		    	{
			    	searchPath = f.getAbsolutePath();
		    	}
	    	}
	    	else
	    	{
	    		playlistRecieved(null, PlayList.createNewListWithFiles(files, false, false), null);
	    	}
	    }
	}
906748
public static void copyFiles(String[] files, String[] destinationFiles) throws IOException {
        copyFiles(getFiles(files), getFiles(destinationFiles));
    }
977339
@Pure
	public static File join(File fileBase, File... elements) {
		if (fileBase == null) {
			return null;
		}
		final StringBuilder buf = new StringBuilder(fileBase.getPath());
		for (final File elt : elements) {
			if (!elt.isAbsolute() && buf.length() >= 0 && buf.charAt(buf.length() - 1) != File.separatorChar) {
				buf.append(File.separatorChar);
			}
			buf.append(elt.getPath());
		}
		return new File(buf.toString());
	}
1280821
public SetBuilder<T> add(T... items) {
        set.addAll(Arrays.asList(items));
        return this;
    }
1180378
public static FileBatch forFiles(List<File> files) throws IOException {
        List<String> origPaths = new ArrayList<>(files.size());
        List<byte[]> bytes = new ArrayList<>(files.size());
        for (File f : files) {
            bytes.add(FileUtils.readFileToByteArray(f));
            origPaths.add(f.toURI().toString());
        }
        return new FileBatch(bytes, origPaths);
    }
922162
public T addFile(String file) {
    checkNotNull(file, "file");
    builder.files.add(file);
    return self();
  }