Package com.opentext.ia.sdk.sip
Class FileGenerator<C>
- java.lang.Object
-
- com.opentext.ia.sdk.sip.Generator<C>
-
- com.opentext.ia.sdk.sip.FileGenerator<C>
-
- Type Parameters:
C
- The type of components to assemble
public class FileGenerator<C> extends Generator<C>
Generate a file by assembling components.
-
-
Constructor Summary
Constructors Constructor Description FileGenerator(Assembler<C> assembler)
Assemble a file using the given assembler into a temporary directory.FileGenerator(Assembler<C> assembler, java.io.File dir)
Assemble a file using the given assembler into the given directory.FileGenerator(Assembler<C> assembler, java.util.function.Supplier<java.io.File> fileSupplier)
Assemble a file using the given assembler into the given directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileGenerationMetrics
generate(C component)
Generate a file from a single component.FileGenerationMetrics
generate(java.lang.Iterable<C> components)
Generate a file by assembling components.FileGenerationMetrics
generate(java.util.Enumeration<C> components)
Generate a file by assembling components.FileGenerationMetrics
generate(java.util.Iterator<C> components)
Generate a file by assembling components.
-
-
-
Constructor Detail
-
FileGenerator
public FileGenerator(Assembler<C> assembler)
Assemble a file using the given assembler into a temporary directory.- Parameters:
assembler
- The assembler to build up the file
-
FileGenerator
public FileGenerator(Assembler<C> assembler, java.io.File dir)
Assemble a file using the given assembler into the given directory.- Parameters:
assembler
- The assembler to build up the filedir
- The directory in which to generate the file
-
FileGenerator
public FileGenerator(Assembler<C> assembler, java.util.function.Supplier<java.io.File> fileSupplier)
Assemble a file using the given assembler into the given directory.- Parameters:
assembler
- The assembler to build up the filefileSupplier
- A function that supplies the file to write to
-
-
Method Detail
-
generate
public FileGenerationMetrics generate(java.lang.Iterable<C> components) throws java.io.IOException
Generate a file by assembling components.- Parameters:
components
- The components to assemble- Returns:
- The generated file and metrics about the generation process
- Throws:
java.io.IOException
- When an I/O error occurs
-
generate
public FileGenerationMetrics generate(java.util.Iterator<C> components) throws java.io.IOException
Generate a file by assembling components.- Parameters:
components
- The components to assemble- Returns:
- The generated file and metrics about the generation process
- Throws:
java.io.IOException
- When an I/O error occurs
-
generate
public FileGenerationMetrics generate(java.util.Enumeration<C> components) throws java.io.IOException
Generate a file by assembling components.- Parameters:
components
- The components to assemble- Returns:
- The generated file and metrics about the generation process
- Throws:
java.io.IOException
- When an I/O error occurs
-
generate
public FileGenerationMetrics generate(C component) throws java.io.IOException
Generate a file from a single component.- Parameters:
component
- The component to generate the file from- Returns:
- The generated file and metrics about the generation process
- Throws:
java.io.IOException
- When an I/O error occurs
-
-