{@inheritDoc}

@see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Archive, java.lang.String, java.lang.Class)
177039
@Override
    public T add(final Archive<?> archive, final String path, final Class<? extends StreamExporter> exporter) {
        Validate.notNull(archive, "Archive must be specified");
        Validate.notNullOrEmpty(path, "Archive Path must be specified");
        Validate.notNull(exporter, "exporter must be specified");
        return this.add(archive, ArchivePaths.create(path), exporter);
    }
154277
@Override
    public T addAsLibraries(Archive<?>... archives) throws IllegalArgumentException {
        Validate.notNull(archives, "Archives must be specified");
        for (final Archive<?> archive : archives) {
            addAsLibrary(archive);
        }
        return covarientReturn();
    }
604401
@Override
    public T addAsLibraries(final Archive<?>[]... archives) throws IllegalArgumentException {
        Validate.notNullAndNoNullValues(archives, "Archives must be specified");
        for (Archive<?>[] archiveArray : archives) {
            for (Archive<?> archive : archiveArray) {
                this.addAsLibraries(archive);
            }
        }
        return covarientReturn();
    }
915961
public void addFileRepositoryCollectionClass(
      Class<? extends FileRepositoryCollection> clazz, Set<String> fileExtensions) {
    for (String extension : fileExtensions) {
      fileRepositoryCollections.put(extension.toLowerCase(), clazz);
    }
  }
480162
public void add(String cssClass) {
    if (StringUtils.isBlank(cssClass)) {
      return;
    }
    String[] parts = StringUtils.split(cssClass, " ");
    for (String part : parts) {
      items.add(StringUtils.trim(part));
    }
  }
1287513
public List<? extends Archive> asList(final Class<? extends Archive> archive) {

      final List<Archive> archives = new ArrayList<>();
      final GradleEffectiveDependencies gradleEffectiveDependencies = GradleRunner.getEffectiveDependencies(projectDirectory);

      for (ScopeType scopeType : scopeTypesDependencies) {
         final List<File> dependenciesByScope = gradleEffectiveDependencies.getDependenciesByScope(scopeType);
         for (File dependency : dependenciesByScope) {
            try {
               final Archive dep = ShrinkWrap.create(ZipImporter.class, dependency.getName()).importFrom(dependency).as(archive);
               archives.add(dep);
            } catch (Exception e) {
               log.log(Level.WARNING, "Cannot import gradle dependency " + dependency + ". Not a zip-like format", e);
            }
         }
      }
      return archives;
   }
5779
@Override
    public T addHandlers(ArchiveEventHandler... handlers) {
        for (ArchiveEventHandler handler : handlers) {
            this.getArchive().addHandlers(handler);
        }
        return covarientReturn();
    }
788387
@Override
    public boolean add(D item) throws UnsupportedOperationException {
        readOnlyGuardCondition();
        instance.addRelation(entity, writeAttributeName, item);
        entity.save();
        return true;
    }
1291633
@Override
    public I importFrom(final File file, Filter<ArchivePath> filter) throws ArchiveImportException {
        Validate.notNull(file, "File must be specified");
        if (!file.exists()) {
            throw new IllegalArgumentException("Specified file for import does not exist: " + file);
        }
        if (file.isDirectory()) {
            throw new IllegalArgumentException("Specified file for import is a directory: " + file);
        }

        final S archive;
        try {
            archive = this.getInputStreamForFile(file);
        } catch (final IOException e) {
            throw new ArchiveImportException("Could not read archive file " + file, e);
        }

        return this.importFrom(archive, filter);

    }
1186083
@Override
    public T addAsModules(final Archive<?>... archives) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(archives, "archives must be specified");

        // Add each
        for (final Archive<?> archive : archives) {
            this.addAsModule(archive);
        }

        // Return
        return this.covarientReturn();
    }
46167
@Override
    public T add(Asset asset, ArchivePath path) {
        Validate.notNull(asset, "No asset was specified");
        Validate.notNull(path, "No path was specified");

        return addAsset(path, asset);
    }
1109339
private File createArchive() throws Exception {
        getLog().info("Creating archive.");
        Artifact artifact = mavenProject.getArtifact();
        String clsfr = noclassifier ? "" : ("-" + classifier);
        String archiveName = artifact.getArtifactId() + "-" + artifact.getVersion() + clsfr + ".jar";
        File jarFile = new File(mavenProject.getBuild().getDirectory(), archiveName);
        MavenArchiver archiver = new MavenArchiver();
        jarArchiver.addDirectory(stagingDirectory);
        archiver.setArchiver(jarArchiver);
        archiver.setOutputFile(jarFile);
        archiver.createArchive(mavenSession, mavenProject, archiveConfig);
        
        if (noclassifier) {
            artifact.setFile(jarFile);
        } else {
            projectHelper.attachArtifact(mavenProject, jarFile, classifier);
        }
        
        FileUtils.deleteDirectory(stagingDirectory);
        return jarFile;
    }
221136
public static void addCacheArchive(URI uri, Configuration conf) {
    String archives = conf.get("mapred.cache.archives");
    conf.set("mapred.cache.archives", archives == null ? uri.toString()
             : archives + "," + uri.toString());
  }
775183
@Override
    public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(source, "No source archive was specified");
        Validate.notNull(path, "No path was specified");
        Validate.notNull(filter, "No filter was specified");

        // Get existing contents from source archive
        final Map<ArchivePath, Node> sourceContent = source.getContent();
        Validate.notNull(sourceContent, "Source archive content can not be null.");

        // Add each asset from the source archive
        for (final Entry<ArchivePath, Node> contentEntry : sourceContent.entrySet()) {
            final Node node = contentEntry.getValue();
            ArchivePath nodePath = new BasicPath(path, contentEntry.getKey());
            if (!filter.include(nodePath)) {
                continue;
            }
            // Delegate
            if (node.getAsset() == null) {
                addAsDirectory(nodePath);
            } else {
                add(node.getAsset(), nodePath);
            }
        }
        return covariantReturn();
    }
775534
public void add(Object source) {
		if(source instanceof InputStream) {
			add((InputStream)source);
		} else if(source instanceof URL) {
			add((URL)source);
		} else if(source instanceof String) {
			add((String)source);
		} else {
			throw new JclException("Unknown Resource type");
		}

	}
190487
private void addFileElements(Collection<ArchiveEntry> files, Element filesElement) throws Exception
    {
        for (ArchiveEntry entry : files) {
            // Don't add files in META-INF to the package.xml file
            if (entry.getName().indexOf("META-INF") == -1) {
                XWikiDocument xdoc = getDocFromXML(entry.getFile());
                String reference = xdoc.getReference();
                Element element = new DOMElement(FILE_TAG);
                element.setText(reference);
                element.addAttribute("language", xdoc.getLocale());
                element.addAttribute("defaultAction", "0");

                // Add configured properties
                XAREntry cfgEntry = getEntryMap().get(reference);
                if (cfgEntry != null && cfgEntry.getType() != null) {
                    element.addAttribute("type", cfgEntry.getType());
                }

                filesElement.add(element);
            }
        }
    }
966302
@Override
    public T merge(Archive<?> source, Filter<ArchivePath> filter) throws IllegalArgumentException {
        return merge(source, new BasicPath(), filter);
    }