public final class LdifConfigExtractor
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
CONFIG_SUBDIR |
private static java.util.regex.Pattern |
EXTRACT_PATTERN |
static java.lang.String |
LDIF_CONFIG_FILE |
private static org.slf4j.Logger |
LOG |
| Modifier | Constructor and Description |
|---|---|
private |
LdifConfigExtractor() |
| Modifier and Type | Method and Description |
|---|---|
private static java.io.File |
assembleDestinationFile(java.io.File outputDirectory,
java.util.Stack<java.lang.String> fileComponentStack)
Assembles the destination file by appending file components previously
pushed on the fileComponentStack argument.
|
private static void |
copyFile(java.io.File source,
java.io.File destination)
Copies a file line by line from the source file argument to the
destination file argument.
|
static void |
extract(java.io.File outputDirectory,
boolean overwrite)
Extracts the LDIF files from a Jar file or copies exploded LDIF resources.
|
private static void |
extractFromJar(java.io.File outputDirectory,
java.lang.String resource)
Extracts the LDIF schema resource from a Jar.
|
static java.lang.String |
extractSingleFileConfig(java.io.File configDir,
java.lang.String file,
boolean overwrite)
extracts or overwrites the configuration LDIF file and returns the absolute path of this file
|
private static java.io.File |
getDestinationFile(java.io.File outputDirectory,
java.io.File resource)
Calculates the destination file.
|
public static final java.lang.String LDIF_CONFIG_FILE
private static final java.lang.String CONFIG_SUBDIR
private static final org.slf4j.Logger LOG
private static final java.util.regex.Pattern EXTRACT_PATTERN
public static void extract(java.io.File outputDirectory,
boolean overwrite)
throws java.io.IOException
overwrite - over write extracted structure if true, false otherwisejava.io.IOException - if schema already extracted and on IO errorsprivate static void copyFile(java.io.File source,
java.io.File destination)
throws java.io.IOException
source - the source file to copydestination - the destination to copy the source tojava.io.IOException - if there are IO errors or the source does not existprivate static void extractFromJar(java.io.File outputDirectory,
java.lang.String resource)
throws java.io.IOException
resource - the LDIF schema resourcejava.io.IOException - if there are IO errorsprivate static java.io.File getDestinationFile(java.io.File outputDirectory,
java.io.File resource)
resource - the source fileprivate static java.io.File assembleDestinationFile(java.io.File outputDirectory,
java.util.Stack<java.lang.String> fileComponentStack)
fileComponentStack - stack containing pushed file componentspublic static java.lang.String extractSingleFileConfig(java.io.File configDir,
java.lang.String file,
boolean overwrite)
configDir - the directory where the config file should be extracted tooverwrite - flag to indicate to overwrite the config file if already present in the given config directory