Package org.glassfish.internal.embedded
Class ScatteredArchive.Builder
- java.lang.Object
-
- org.glassfish.internal.embedded.ScatteredArchive.Builder
-
- Enclosing class:
- ScatteredArchive
public static class ScatteredArchive.Builder extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScatteredArchive.Builder.typeSupported types of scattered archives.
-
Constructor Summary
Constructors Constructor Description Builder(String name, File topDir)Construct a new scattered archive builder with the minimum information By default, a scattered archive is not different from any other archive where all the files are located under a top level directory (topDir).Builder(String name, Collection<URL> urls)Construct a new scattered archive builder with a set of URLs as repository for locating archive resources (like .class files).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScatteredArchive.BuilderaddClassPath(File location)Adds a directory to the classes classpath.ScatteredArchive.BuilderaddClassPath(URL classpath)Adds a URL for the classes classpath.ScatteredArchive.BuilderaddMetadata(File metadata)Add a new metadata locator for this scattered archive.ScatteredArchive.BuilderaddMetadata(String name, File metadata)Add a new metadata locator for this scattered archive.ScatteredArchivebuildJar()Creates a new scattered jar file using this builder instance configuration.ScatteredArchivebuildWar()Creates a new scattered war file using this builder instance configuration.ScatteredArchive.Builderresources(File resources)Sets the location of resources files
-
-
-
Constructor Detail
-
Builder
public Builder(String name, File topDir)
Construct a new scattered archive builder with the minimum information By default, a scattered archive is not different from any other archive where all the files are located under a top level directory (topDir). Some files can then be scattered in different locations and be specified through the appropriate setters. Alternatively, topDir can be null to specify a truely scattered archive and all the locations must be specified.- Parameters:
name- archive nametopDir- top level directory
-
Builder
public Builder(String name, Collection<URL> urls)
Construct a new scattered archive builder with a set of URLs as repository for locating archive resources (like .class files).- Parameters:
name- archive nameurls- set of resources repository
-
-
Method Detail
-
resources
public ScatteredArchive.Builder resources(File resources)
Sets the location of resources files- Parameters:
resources- the resources directory- Returns:
- itself
-
addMetadata
public ScatteredArchive.Builder addMetadata(File metadata)
Add a new metadata locator for this scattered archive. A metadata is identified by its name (like WEB-INF/web.xml) and the location of the metadata is used when the embedded server is requesting the metadata file. The name for this metadata will be obtained by doing metadata.getName()- Parameters:
metadata- the metadata file location- Returns:
- itself
-
addMetadata
public ScatteredArchive.Builder addMetadata(String name, File metadata)
Add a new metadata locator for this scattered archive. A metadata is identified by its name (like WEB-INF/web.xml) and the location of the metadata is used when the embedded server is requesting the metadata file.- Parameters:
name- name of the metadata (eg WEB-INF/web.xml or web.xml or META-INF/ejb.xml or ejb.xml).metadata- the metadata file location- Returns:
- itself
-
addClassPath
public ScatteredArchive.Builder addClassPath(File location)
Adds a directory to the classes classpath. Will be used to retrieve requested .class files.- Parameters:
location- must be a directory location- Returns:
- itself
-
addClassPath
public ScatteredArchive.Builder addClassPath(URL classpath)
Adds a URL for the classes classpath. Will be used to retrieve requested .class files- Parameters:
classpath- the new classpath element.- Returns:
- itself
-
buildJar
public ScatteredArchive buildJar()
Creates a new scattered jar file using this builder instance configuration. The resulting instance will behave like a jar file when introspected by the embedded instance.- Returns:
- new scattered instance jar file
-
buildWar
public ScatteredArchive buildWar()
Creates a new scattered war file using this builder instance configuration. The resulting instance will behave like a war file when introspected by the embedded instance.- Returns:
- the scattered instance war file
-
-