public static class PathScriptArchive.Builder
extends java.lang.Object
PathScriptArchive
.
Default settings: * generate a moduleId using the last element of thePath
* all files under the root path will be included in the archive. * searches for a module spec file under the root directory called "moduleSpec.json" and uses theGsonScriptModuleSpecSerializer
to deserialize it.
Constructor and Description |
---|
PathScriptArchive.Builder(java.nio.file.Path rootDirPath)
Start a builder with required parameters.
|
Modifier and Type | Method and Description |
---|---|
PathScriptArchive.Builder |
addFile(java.nio.file.Path file)
Append a single file to the archive
|
PathScriptArchive |
build()
Build the
PathScriptArchive . |
PathScriptArchive.Builder |
setCreateTime(long createTime)
Set the creation time
|
PathScriptArchive.Builder |
setModuleSpec(ScriptModuleSpec moduleSpec)
Set the module spec for this archive
|
PathScriptArchive.Builder |
setModuleSpecSerializer(ScriptModuleSpecSerializer specSerializer)
override the default module spec file name
|
PathScriptArchive.Builder |
setRecurseRoot(boolean recurseRoot)
If true, then add all of the files underneath the root path.
|
public PathScriptArchive.Builder(java.nio.file.Path rootDirPath)
rootDirPath
- absolute path to the root directory to recursively addpublic PathScriptArchive.Builder setRecurseRoot(boolean recurseRoot)
public PathScriptArchive.Builder setModuleSpec(ScriptModuleSpec moduleSpec)
public PathScriptArchive.Builder setModuleSpecSerializer(ScriptModuleSpecSerializer specSerializer)
public PathScriptArchive.Builder addFile(java.nio.file.Path file)
file
- relative path from the rootpublic PathScriptArchive.Builder setCreateTime(long createTime)
public PathScriptArchive build() throws java.io.IOException
PathScriptArchive
.java.io.IOException