public class IOUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DIRECTORY
The default directory to search for features.
|
static String |
DEFAULT_FEATURE_FILE
The default name of the feature file.
|
static String |
EXTENSION_FEATURE_FILE
The extension for a feature file.
|
static String |
EXTENSION_REF_FILE
The extension for a reference file.
|
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.sling.feature.Feature |
getFeature(String url,
ArtifactManager artifactManager,
FeatureJSONReader.SubstituteVariables substituteVariables)
Read the feature
|
static List<String> |
getFeatureFiles(File homeDirectory,
String... files)
Get the list of feature files.
|
static org.apache.sling.feature.ArtifactId |
getFelixFrameworkId(String version)
Get an artifact id for the Apache Felix framework
|
static List<String> |
parseFeatureRefFile(File file)
Parse a feature reference file
|
public static final String EXTENSION_REF_FILE
public static final String EXTENSION_FEATURE_FILE
public static final String DEFAULT_DIRECTORY
public static final String DEFAULT_FEATURE_FILE
public static List<String> parseFeatureRefFile(File file) throws IOException
file - The fileIOException - If reading failspublic static List<String> getFeatureFiles(File homeDirectory, String... files) throws IOException
null or an empty array, the default is used.
The default checks for the following places, the first one found is used. If none is
found an empty list is returned.
DEFAULT_DIRECTORY in the current directory
DEFAULT_FEATURE_FILE in the current directory
DEFAULT_DIRECTORY in the home directory
DEFAULT_FEATURE_FILE in the home directory
EXTENSION_FEATURE_FILE or
EXTENSION_REF_FILE of that directory are read.
If a file ends in EXTENSION_REF_FILE the contents is read and every line not
starting with the hash sign is considered a reference to a feature artifact.homeDirectory - If relative files should be resolved, this is the directory to usefiles - Optional list of files. If none is provided, a default is used.IOException - If an error occurs.public static org.apache.sling.feature.Feature getFeature(String url, ArtifactManager artifactManager, FeatureJSONReader.SubstituteVariables substituteVariables) throws IOException
url - The feature urlartifactManager - The artifact manager to read the featuresubstituteVariables - Variable substitution handlingIOException - If reading failspublic static org.apache.sling.feature.ArtifactId getFelixFrameworkId(String version)
version - The version to use or null for the default versionIllegalArgumentException - If the provided version is invalidCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.