Add a new fileset.

@return ZipFileSet
349252
public function createFileSet()
    {
        $this->fileset = new ZipFileSet();
        $this->filesets[] = $this->fileset;

        return $this->fileset;
    }
365412
protected function buildFileAndDirectoryListing()
    {
        $collection  = new Collection;
        $files       = $this->scanFiles($this->currentDir);
        $thumbnails  = $this->buildThumbnails($files);
        $directories = $this->scanDirectory($this->currentDir);

        if ($this->getRootDir() <> $this->currentDir) {
            $back_directory    = implode('/', explode('/', $this->currentDir, -1));
            $item              = [];
            $item['thumbnail'] = '';
            $item['filename']  = '...';
            $item['size']      = '';
            $item['type']      = 'back';
            $item['icon']      = 'fa-reply';
            $item['path']      = $this->currentDir;
            $item['url']       = '?folder=' . $back_directory;
            $item['delete']    = current_user()->can('media.delete');
            $item['select']    = current_user()->can('media.view');
            $collection->add($item);
        }

        foreach ($directories as $directory) {
            $directory_name = explode('/', $directory);
            $directory_name = array_pop($directory_name);

            $item              = [];
            $item['thumbnail'] = '';
            $item['filename']  = $directory_name;
            $item['path']      = $directory;
            $item['size']      = '';
            $item['type']      = 'directory';
            $item['icon']      = 'fa-folder';
            $item['url']       = '?folder=' . $directory;
            $item['delete']    = current_user()->can('media.delete');
            $item['select']    = current_user()->can('media.view');

            $collection->add($item);
        }

        foreach ($files as $path) {
            $item     = [];
            $parts    = explode('/', $path);
            $filename = array_pop($parts);
            $size     = Storage::size($path);
            $icon     = file_ext_to_icon(File::extension($path));

            $item['type']      = 'file';
            $item['icon']      = $icon;
            $item['thumbnail'] = '';
            if (file_can_have_thumbnail($path)) {
                $item['type']      = 'image';
                $item['icon']      = 'fa-image';
                $item['thumbnail'] = $thumbnails[$path];
            }

            $item['filename'] = $filename;
            $item['size']     = $size;
            $item['url']      = Storage::url($path);
            $item['path']     = $path;
            $item['delete']   = current_user()->can('media.delete');
            $item['select']   = current_user()->can('media.view');
            $collection->add($item);
        }

        return $collection;
    }
213304
function FileSet() {
  var self = this

  self.files = []
  self.origins = []

  self.expected = 0
  self.actual = 0

  self.pipeline = trough()
  self.plugins = []

  events.init.call(self)

  self.on('one', one.bind(self))
}
1155198
public function setTargetfile()
	{
		//set the upload_path_relative
		$this->upload_path_relative = $this->upload_path . $this->target_file_name;

		//set the full target file path
		$this->target_file = $this->target_dir . $this->target_file_name;

		return $this;

	}
44408
protected function createMetaInfoFolderAndFile()
    {
        $this->metaInfFolder = $this->createFolder($this->rootFolder, self::META_INF_FOLDER_NAME);

        $this->createManifestFile();

        return $this;
    }
512232
public function addCodeDefinitionSet(CodeDefinitionSet $set)
    {
        foreach ($set->getCodeDefinitions() as $def) {
            $this->addCodeDefinition($def);
        }

        return $this;
    }
651761
public function create()
    {
        if (! $this->adapter->fileExists($this->path, true)) {
            // ensure the parent directory exists
            new Directory(dirname($this->path), $this->adapter);

            if ($this->adapter->createFile($this->path) === false) {
                $this->throwUnableToCreate();
            }
        }

        return $this;
    }
136674
public function addFiles($filePaths): self
    {
        if (is_string($filePaths)) {
            $filePaths = [$filePaths];
        }

        foreach ($filePaths as $filePath) {
            if (! empty($filePath)) {
                file_put_contents($this->manifestPath, $filePath.PHP_EOL, FILE_APPEND);
            }
        }

        return $this;
    }
1262694
public function createManifestFile() {
		
		$app = Application::getInstance();
		
		// lambda method to add an array to the XML
		$addChildArray = function ($element, $list) use ($app, &$addChildArray) {
			
			foreach ($list as $name => $value) {
				
				// if is an array, run again recursively
				if (is_array($value)) {
					$listChild = $element->addChild($name);
					$addChildArray($listChild, $value);
				} else if (is_int($value) or is_string($value)) {
					$element->addChild($name, (string)$value);
				} else {
					$app->logError('Option item ' . $name . ' is not valid');
				}
			
			}
			
		};
		
		// prevent missing folders
		if (!is_dir($this->baseFolder)) {
			$app->logError('Folder ' . $this->baseFolder . ' of ' . $this->name . ' ' . $this->type . ' plugin cannot be accessed');
			return FALSE;
		}
	
		$manifest = new \SimpleXMLElement('<!DOCTYPE xml><manifest></manifest>');
	
		$plugin = $manifest->addChild('plugin');

		// plugin type
		$plugin->addAttribute('type', $this->type);
		
		// more infos
		$plugin->addChild('name',			$this->name);
		$plugin->addChild('folder',			basename($this->baseFolder));
		$plugin->addChild('version',		$this->version);
		$plugin->addChild('dateReleased',	$this->dateReleased);
		$plugin->addChild('appVersion',		$this->appVersion);
		
		// custom options
		$optionsChild = $plugin->addChild('options');
		
		// recursively add options elements
		$addChildArray($optionsChild, $this->options);
		
		// will contains all found files
		$filesChild = $plugin->addChild('files');
		
		// list all found files as multi-dimensional array
		$files = Utilities::getDirectoryFilenames($this->baseFolder);
		
		// adds file to <files> child
		foreach ($files as $file) {
			$filesChild->addChild('file', $file);
		}
	
		$filename = $this->baseFolder . '/manifest.xml';
		
		try {
			$res = $manifest->asXML($filename);
			$app->logEvent('Created manifest file ' . $filename . ' for ' . $this->type . ' plugin');
		} catch (\Exception $e) {
			$res = FALSE;
			$app->logError('Manifest file ' . $filename . ' creation failed for ' . $this->type . ' plugin: ' . $e->getMessage());
		}
		
		return $res;
	
	}
309274
public void addFile(String zipEntry, String filename) throws IOException {
		addFile(zipEntry, new File(filename));
	}
786049
public function addSettingsFile() {
        $config = new Zend_Config(array(), true);
        $config->gumball = array();
        $config->gumball->sourceDbEnvironment = $this->_dbEnv;

        $writer = new Zend_Config_Writer_Ini(
            array(
                'config' => $config,
                'filename' => $this->_getTargetDirectoryPath() . '/application/configs/gumball.ini'
            )
        );
        $writer->setRenderWithoutSections();
        $writer->write();
    }
292081
public function add($files, string $nameInZip = null): self
    {
        if (is_array($files)) {
            $nameInZip = null;
        }

        if (is_string($files)) {
            $files = [$files];
        }

        foreach ($files as $file) {
            if (file_exists($file)) {
                $this->zipFile->addFile($file, ltrim($nameInZip, DIRECTORY_SEPARATOR)).PHP_EOL;
            }
            $this->fileCount++;
        }

        return $this;
    }
166704
public function findFiles()
    {
        $files = $this->getFilesystemDisk()->listContents($this->getFilesPath());
        foreach ($files as $fileData) {
            $this->addNewFileFromArray($fileData);
        }
    }
57988
protected function createDocPropsFolderAndFiles()
    {
        $this->docPropsFolder = $this->createFolder($this->rootFolder, self::DOC_PROPS_FOLDER_NAME);

        $this->createAppXmlFile();
        $this->createCoreXmlFile();

        return $this;
    }
161784
public function compileFiles()
    {
        foreach ($this->files as $file) {
            $activeConfig = $this->parser->setConfigFile($file)->getActiveConfig();
            $this->add($activeConfig);
        }

        return $this;
    }
1142569
function jshintFileset(fileset) {
    var files = [];
    fileset.forEach(function (file) {
        if (isDirectory(file)) {
            files.push(file + '**/*.js');
        } else {
            files.push(file);
        }
    });

    return files;
}
1311780
public function createZipContent()
    {
        $zipFile = $this->createZipFile();
        $content = file_get_contents($zipFile);
        unlink($zipFile);

        return $content;
    }