Class Zip
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.defaultInstantiators.Zip
-
-
Constructor Summary
Constructors Constructor Description Zip()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<FileArtifact>add(Path base, Collection<FileArtifact> artifacts, Path target, ZipHandler handler)Packssourcefiles intotargetusing handler.static Set<FileArtifact>toFileArtifactSet(java.util.List<java.io.File> files, ArtifactModel model)Turns a list of files into related file artifacts.static java.util.List<java.io.File>toFileList(Collection<FileArtifact> artifacts)Turns a collection of file artifacts into files.static Set<FileArtifact>zip(Path base, Path artifacts, Path zip)Packssourcefiles intotarget.static Set<FileArtifact>zip(Path base, Collection<FileArtifact> artifacts, Path zip)Packssourcefiles intotarget.
-
-
-
Method Detail
-
zip
public static Set<FileArtifact> zip(Path base, Path artifacts, Path zip) throws VilException
Packssourcefiles intotarget.- Parameters:
base- the base path used to make the paths of theartifactsrelative, may be the source or target projectartifacts- the artifacts to be handledzip- the target zip file- Returns:
- the created artifacts
- Throws:
VilException- in case that processing the JAR file fails for some reason
-
zip
public static Set<FileArtifact> zip(Path base, Collection<FileArtifact> artifacts, Path zip) throws VilException
Packssourcefiles intotarget.- Parameters:
base- the base path used to make the paths of theartifactsrelative, may be the source or target projectartifacts- the artifacts to be handledzip- the target zip file- Returns:
- the created artifacts
- Throws:
VilException- in case that processing the JAR file fails for some reason
-
add
public static Set<FileArtifact> add(Path base, Collection<FileArtifact> artifacts, Path target, ZipHandler handler) throws VilException
Packssourcefiles intotargetusing handler.- Parameters:
base- the base path used to make the paths of theartifactsrelative, may be the source or target projectartifacts- the artifacts to be handledtarget- the target ZIP/JAR filehandler- the actual ZIP handler- Returns:
- the created artifacts
- Throws:
VilException- in case that processing the JAR file fails for some reason
-
toFileList
public static final java.util.List<java.io.File> toFileList(Collection<FileArtifact> artifacts)
Turns a collection of file artifacts into files.- Parameters:
artifacts- the artifacts to be processed- Returns:
- the corresponding files
-
toFileArtifactSet
public static final Set<FileArtifact> toFileArtifactSet(java.util.List<java.io.File> files, ArtifactModel model) throws VilException
Turns a list of files into related file artifacts.- Parameters:
files- the files to be turned into file artifactsmodel- the artifact model to be used (may be null for auto-detection)s- Returns:
- the set of file artifacts
- Throws:
VilException- if creating a file artifact instance fails
-
-