Add a {@link VirtualFile} to the assembly.

@param virtualFile
183840
public void add(VirtualFile virtualFile) {
        String path = virtualFile.getName();
        AssemblyNode assemblyNode = rootNode.findOrBuild(path);
        assemblyNode.setTarget(virtualFile);
    }
478856
public void addFile(
        String loaderPath,
        URL file
    ) {
        List list = (List) filesMap.get(loaderPath);

        if (list == null) {
            list = new ArrayList();
            filesMap.put(
                loaderPath,
                list
            );
        }

        list.add(file);
    }
1274061
@SuppressWarnings("deprecation")
  private void addLocalFiles(Path jobFileDir, String jobFileList, Configuration conf) throws IOException {
    DistributedCache.createSymlink(conf);
    for (String jobFile : SPLITTER.split(jobFileList)) {
      Path srcJobFile = new Path(jobFile);
      // DistributedCache requires absolute path, so we need to use makeQualified.
      Path destJobFile = new Path(this.fs.makeQualified(jobFileDir), srcJobFile.getName());
      // Copy the file from local file system to HDFS
      this.fs.copyFromLocalFile(srcJobFile, destJobFile);
      // Create a URI that is in the form path#symlink
      URI destFileUri = URI.create(destJobFile.toUri().getPath() + "#" + destJobFile.getName());
      LOG.info(String.format("Adding %s to DistributedCache", destFileUri));
      // Finally add the file to DistributedCache with a symlink named after the file name
      DistributedCache.addCacheFile(destFileUri, conf);
    }
  }
907243
public void loadPropertiesFromFile(final String propertiesFile)
			throws IOException {
		LOG.info("Loading properties from file: " + propertiesFile);
		File file = new File(propertiesFile);

		String bundleName = file.getPath().substring(0,
				file.getPath().indexOf("properties") - 1);
		FileInputStream inputStream = null;

		try {
			inputStream = new FileInputStream(file);
			ResourceBundle bundle = new PropertyResourceBundle(inputStream);
			LOG.info("Adding to bunlde: " + bundleName);
			bundles.put(bundleName, bundle);
		} finally {
			if (inputStream != null) {
				inputStream.close();
			}
		}

	}
1219423
public static boolean addHandle(VirtualFile owner, Closeable handle) {
        RegistryEntry entry = getEntry(owner);
        return entry.handles.add(handle);
    }
204491
private void addPropertyBundle(CmsResource bundleResource) {

        NameAndLocale nameAndLocale = getNameAndLocale(bundleResource);
        Locale locale = nameAndLocale.getLocale();

        String baseName = nameAndLocale.getName();
        m_bundleBaseNames.add(baseName);
        LOG.info(
            String.format(
                "Adding property VFS bundle (path=%s, name=%s, locale=%s)",
                bundleResource.getRootPath(),
                baseName,
                "" + locale));
        Locale paramLocale = locale != null ? locale : CmsLocaleManager.getDefaultLocale();
        CmsVfsBundleParameters params = new CmsVfsBundleParameters(
            nameAndLocale.getName(),
            bundleResource.getRootPath(),
            paramLocale,
            locale == null,
            CmsVfsResourceBundle.TYPE_PROPERTIES);
        CmsVfsResourceBundle bundle = new CmsVfsResourceBundle(params);
        addBundle(baseName, locale, bundle);
    }
1059041
public static void copyFile(File srcFile, File destFile) {
		OutputStream out = null;
		InputStream in = null;
		try {
			if (!destFile.getParentFile().exists())
				destFile.getParentFile().mkdirs();

			in = new FileInputStream(srcFile);
			out = new FileOutputStream(destFile);

			// Transfer bytes from in to out
			byte[] buf = new byte[1024];
			int len;
			while ((len = in.read(buf)) > 0) {
				out.write(buf, 0, len);
			}
			in.close();
			out.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
1094585
public void addFile(String zipEntry, File file) throws IOException {
		String zipEntryName = Strings.isValid(zipEntry) ? zipEntry : file.getName();
		logger.debug("adding '{}' as '{}'", file.getName(), zipEntryName);
		try(InputStream input = new FileInputStream(file)) {
			addFile(zipEntryName, input);
		}
	}
759366
private void addFile(File root, File file, String prefix, ZipOutputStream zos) throws IOException {
        FileInputStream fis = new FileInputStream(file);
        ZipEntry jarEntry = new ZipEntry(prefix + normalizePath(root, file));
        zos.putNextEntry(jarEntry);
        StreamUtils.copyStream(fis, zos, false);
        fis.close();
    }
463493
@Override
    public void attachScriptFile(IScriptable target, IScriptFile scriptFile) {
        mScriptMap.put(target, scriptFile);
        scriptFile.invokeFunction("onAttach", new Object[] { target });
    }
1201528
private void addFileEntry(String entryName, InputStream inputStream) throws IOException {
		// write lazily the manifest before adding the first file
		if (manifest != null) {
			addManifestEntry();
		}

		ZipEntry entry = new ZipEntry(entryName);
		filesArchive.putNextEntry(entry);

		inputStream = new BufferedInputStream(inputStream);
		try {
			byte[] buffer = new byte[BUFFER_SIZE];
			for (;;) {
				int bytesRead = inputStream.read(buffer);
				if (bytesRead <= 0) {
					break;
				}
				write(buffer, 0, bytesRead);
			}
		} finally {
			Files.close(inputStream);
			filesArchive.closeEntry();
		}
	}
934459
private static void addFileFunction(CtClass clazz, String property)
        throws NotFoundException, CannotCompileException {
        String wrapperName = property + "wrapper";
        String funcName = "set";
        funcName = funcName + Character.toUpperCase(wrapperName.charAt(0));
        funcName = funcName + wrapperName.substring(1);
        String setterName = "set";
        setterName = setterName + Character.toUpperCase(property.charAt(0));
        setterName = setterName + property.substring(1);
        CtClass[] params = generateClassField(FileWrapper.class);
        CtMethod newFunc = new CtMethod(CtClass.voidType, funcName, params, clazz);
        newFunc.setBody("{ " + setterName + "($1.returnFile());\n }");
        clazz.addMethod(newFunc);
    }
273274
public void addFile(String path, File file, String contentType) throws IOException {
    try (InputStream is = new FileInputStream(file)) {
      addFile(path, is, contentType);
    }
  }
151389
public T addPyFile(String file) {
    checkNotNull(file, "file");
    builder.pyFiles.add(file);
    return self();
  }
1152010
public void addFile(File file) {
        String name = "file";
        files.put(normalizeDuplicateName(name), file);
    }
1019267
public static void addFile(State state, String file) {
    state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
  }
376215
public void addFile(int level, long fileNumber,
            long fileSize,
            InternalKey smallest,
            InternalKey largest)
    {
        FileMetaData fileMetaData = new FileMetaData(fileNumber, fileSize, smallest, largest);
        addFile(level, fileMetaData);
    }