public class ProjectConfigs extends Object
ProjectConfig
Modifier and Type | Field and Description |
---|---|
static String |
FILE_NAME |
static String |
LOCAL_FLOW_FILE_NAME |
Constructor and Description |
---|
ProjectConfigs() |
Modifier and Type | Method and Description |
---|---|
static void |
configureProperties(ProjectConfig config,
Map map)
Configures the given
ProjectConfig with a map of key value pairs from
something like a JBoss Forge command |
static com.fasterxml.jackson.databind.ObjectMapper |
createObjectMapper()
Creates a configured Jackson object mapper for parsing YAML
|
static void |
defaultEnvironments(ProjectConfig config,
String namespace)
If no environments have been configured lets default them from the `FABRIC8_DEFAULT_ENVIRONMENTS` environment variable
|
static ProjectConfig |
findFromFolder(File folder)
Tries to find the project configuration from the current directory or a parent folder.
|
static boolean |
hasConfigFile(File folder)
Returns true if the given folder has a configuration file called
FILE_NAME |
static ProjectConfig |
loadFromFolder(File folder)
Returns the configuration from the
FILE_NAME in the given folder or returns the default configuration |
static ProjectConfig |
loadFromUrl(String url)
Returns the project config from the given url if it exists or null
|
static ProjectConfig |
loadFromUrl(URL url)
Returns the project config from the given url if it exists or null
|
static ProjectConfig |
parseProjectConfig(File file) |
static ProjectConfig |
parseProjectConfig(InputStream input) |
static ProjectConfig |
parseProjectConfig(String yaml) |
static boolean |
saveConfig(ProjectConfig config,
File file)
Saves the configuration as YAML in the given file
|
static boolean |
saveToFolder(File basedir,
ProjectConfig config,
boolean overwriteIfExists)
Saves the fabric8.yml file to the given project directory
|
static String |
toYaml(Object dto) |
public static final String FILE_NAME
public static final String LOCAL_FLOW_FILE_NAME
public static String toYaml(Object dto) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
public static ProjectConfig loadFromFolder(File folder)
FILE_NAME
in the given folder or returns the default configurationpublic static ProjectConfig findFromFolder(File folder)
public static ProjectConfig loadFromUrl(String url)
public static ProjectConfig loadFromUrl(URL url)
public static boolean hasConfigFile(File folder)
FILE_NAME
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper()
public static ProjectConfig parseProjectConfig(File file) throws IOException
IOException
public static ProjectConfig parseProjectConfig(InputStream input) throws IOException
IOException
public static ProjectConfig parseProjectConfig(String yaml) throws IOException
IOException
public static boolean saveToFolder(File basedir, ProjectConfig config, boolean overwriteIfExists) throws IOException
IOException
public static boolean saveConfig(ProjectConfig config, File file) throws IOException
IOException
public static void configureProperties(ProjectConfig config, Map map)
ProjectConfig
with a map of key value pairs from
something like a JBoss Forge commandpublic static void defaultEnvironments(ProjectConfig config, String namespace)
Copyright © 2011–2018 Red Hat. All rights reserved.