public ProjectConfig getProjectConfig() { try { return ProjectConfigs.parseProjectConfig(readFile("fabric8.yml")); } catch (Exception e) { // its fine if no fabric8.yml file is found return null; } }
public ProjectConfig getProjectConfig() { try { return ProjectConfigs.parseProjectConfig(readFile("fabric8.yml")); } catch (Exception e) { // its fine if no fabric8.yml file is found return null; } }
/** * Returns the project config from the given url if it exists or null */ public static ProjectConfig loadFromUrl(URL url) { InputStream input = null; try { input = url.openStream(); } catch (FileNotFoundException e) { LOG.info("No fabric8.yml at URL: " + url); } catch (IOException e) { LOG.warn("Failed to open fabric8.yml file at URL: " + url + ". " + e, e); } if (input != null) { try { LOG.info("Parsing " + ProjectConfigs.FILE_NAME + " from " + url); return ProjectConfigs.parseProjectConfig(input); } catch (IOException e) { LOG.warn("Failed to parse " + ProjectConfigs.FILE_NAME + " from " + url + ". " + e, e); } } return null; }
/** * Returns the configuration from the {@link #FILE_NAME} in the given folder or returns the default configuration */ public static ProjectConfig loadFromFolder(File folder) { File projectConfigFile = new File(folder, FILE_NAME); if (projectConfigFile != null && projectConfigFile.exists() && projectConfigFile.isFile()) { LOG.debug("Parsing fabric8 devops project configuration from: " + projectConfigFile.getName()); try { return ProjectConfigs.parseProjectConfig(projectConfigFile); } catch (IOException e) { LOG.warn("Failed to parse " + projectConfigFile + ". " + e, e); } } return new ProjectConfig(); }
boolean hasFile = false; if (configFile.exists()) { config = ProjectConfigs.parseProjectConfig(configFile); hasFile = true;
File configFile = getProjectConfigFile(context, getSelectedProject(context)); if (configFile != null && configFile.exists()) { config = ProjectConfigs.parseProjectConfig(configFile);