Add the file to the foundFiles or missingFiles arrays based on their existance.
193417
function classifyFile (file) {
    return stat(file).then(({ err, stats }) => {
      if (err) {
        if (err.code === 'ENOENT') {
          missingFiles.push(file)
        } else {
          throw err
        }
      } else {
        foundFiles.push(file)
      }
    })
  }
705214
protected function addStorageFiles()
    {
        $items = $this->package->getStorageServices();
        foreach ($items as $service => $resources) {
            if (is_string($resources)) {
                $resources = explode(',', $resources);
            }
            foreach ($resources as $resourceName => $resource) {
                // If reachable flag is present and service is not reachable then skip it.
                if ($resourceName === static::REACHABLE_FLAG && $resource === false) {
                    continue;
                }

                if (Session::checkServicePermission(
                    Verbs::GET, $service, $resource, Session::getRequestor(), false
                )) {
                    /** @type FileServiceInterface $storage */
                    $storage = ServiceManager::getService($service);
                    if (!$storage) {
                        throw new InternalServerErrorException("Can not find storage service $service.");
                    }

                    if ($storage->folderExists($resource)) {
                        $zippedResource = $this->getStorageFolderZip($storage, $resource);
                        if ($zippedResource !== false) {
                            $newFileName = $service . '/' . rtrim($resource, '/') . '/' . md5($resource) . '.zip';
                            $this->package->zipFile($zippedResource, $newFileName);
                            $this->destructible[] = $zippedResource;
                        }
                    } elseif ($storage->fileExists($resource)) {
                        $content = $storage->getFileContent($resource, null, false);
                        $this->package->zipContent($service . '/' . $resource, $content);
                    }
                }
            }
        }
    }
166704
public function findFiles()
    {
        $files = $this->getFilesystemDisk()->listContents($this->getFilesPath());
        foreach ($files as $fileData) {
            $this->addNewFileFromArray($fileData);
        }
    }
918780
def add(self, files, items):
        
        if isinstance(files, (str, bytes)):
            files = iter([files])
        for pathname in files:
            try:
                values = self._filemap[pathname]
            except KeyError:
                self._filemap[pathname] = items
            else:
                values.extend(items)
151568
protected function addFile(File $file) {
        $files = $this->getFiles();
        $files[$file->getName()] = $file;
        $this->setFiles($files);
    }
28851
def add_files(self, files):
        

        if isinstance(files, basestring):
            files = [files]

        zip_file = None
        if self.zip_:
            zip_filename = self._get_zip_filename()
            zip_file = ZipFile(zip_filename, 'w')

        for filename in files:
            if os.path.isdir(filename):
                for dirname, subdirs, filelist in os.walk(filename):
                    if dirname:
                        if self.zip_:
                            zip_file.write(dirname)

                    for fname in filelist:
                        filepath = os.path.join(dirname, fname)
                        if self.zip_:
                            zip_file.write(filepath)

                        else:
                            fmfile = self.get_file_specs(filepath,
                                                         keep_folders=True)
                            if fmfile['totalsize'] > 0:
                                self._files.append(fmfile)

            else:
                if self.zip_:
                    zip_file.write(filename)

                else:
                    fmfile = self.get_file_specs(filename)
                    self._files.append(fmfile)

        if self.zip_:
            zip_file.close()
            filename = zip_filename
            fmfile = self.get_file_specs(filename)
            self._files.append(fmfile)
1282989
private void addReverse(final File[] files) {
        for (int i = files.length - 1; i >= 0; --i) {
            stack.add(files[i]);
        }
    }
113150
private void openFiles() throws FileNotFoundException {
		// Populate the mFiles array

		final File base = new File(mLocation);
		mFiles.add(new RandomAccessFile(base, "r"));
		mFileNames.add(base.getPath());

		int i = 0;
		for(;;) {
			i = i + 1;
			final File nextFile = new File(mLocation + "-" + i);
			if (nextFile.exists()) {
				mFiles.add(new RandomAccessFile(nextFile, "r"));
				mFileNames.add(nextFile.getPath());
			} else {
				break;
			}
		}
	}
1104419
private void addCurrentDirFiles(List<File> theFiles, List<File> theDirs, File currentDir) {
    File dirs[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return file.isDirectory() && !file.getName().startsWith(".") && !file.getName().equals("META-INF");
      }
      
    });
    
    File htmlFiles[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return !file.isDirectory() && file.isFile() && file.canRead() && !file.getName().startsWith(".") && (file.getName().endsWith(".html") || file.getName().endsWith(".htm"));
      }
      
    });
    
    if(dirs != null && dirs.length > 0) {
      theDirs.addAll(Arrays.asList(dirs));
    }
    if(htmlFiles != null && htmlFiles.length > 0) {
      theFiles.addAll(Arrays.asList(htmlFiles));
    }
  }
1107511
def addList(self, source_id, dir_path, is_recurcive=False, timestamp_reception=None, training_metadata=[]):
        """"""
        if not path.isdir(dir_path):
            raise ValueError(dir_path + ' is not a directory')
        files_to_send = _get_files_from_dir(dir_path, is_recurcive)
        succeed_upload = {}
        failed_upload = {}
        for file_path in files_to_send:
            try:
                resp = self.add(source_id=source_id,
                    file_path=file_path, profile_reference="",
                    timestamp_reception=timestamp_reception, training_metadata=training_metadata)
                if resp['code'] != 200 and resp['code'] != 201:
                    failed_upload[file_path] = ValueError('Invalid response: ' + str(resp))
                else:
                    succeed_upload[file_path] = resp
            except BaseException as e:
                failed_upload[file_path] = e
        result = {
            'success': succeed_upload,
            'fail': failed_upload
        }
        return result
1047929
def _addDPFiles(self, *files):
        """"""
        # quiet flag is always true
        self.new_entry_dialog.addDataProducts(self.purrer.makeDataProducts(
            [(file, True) for file in files], unbanish=True, unignore=True))
552404
def add_file(self, name="", hashalg="", hash="", comClasses=None, 
                 typelibs=None, comInterfaceProxyStubs=None, 
                 windowClasses=None):
        
        self.files.append(File(name, hashalg, hash, comClasses, 
                          typelibs, comInterfaceProxyStubs, windowClasses))
88924
def add_output_file(self, filename):
    
    if filename not in self.__output_files:
      self.__output_files.append(filename)
963037
public MultiFileResource add(File... files) {
		for (File file : files) {
			this.add(new FileResource(file));
		}
		return this;
	}
679464
def addFile(src, dest=nil)
      orig = dest
      dest = File.join(@defaultPath, File.basename(src)) if !dest
      @files[src] = dest
    end
830596
function(){
		for(var i=0; i<DYNAMIC_FILES.length; i++) {
			addFile(dynamicFilesCompiled[i](options), { name: DYNAMIC_FILES[i] });
		}
	}
1069356
public void addAll(ClassLoaderFiles files) {
		Assert.notNull(files, "Files must not be null");
		for (SourceFolder folder : files.getSourceFolders()) {
			for (Map.Entry<String, ClassLoaderFile> entry : folder.getFilesEntrySet()) {
				addFile(folder.getName(), entry.getKey(), entry.getValue());
			}
		}
	}