private void loadRepoConfig() throws IOException { try { repoConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(JGitText.get().unknownRepositoryFormat, e); } }
private void loadSystemConfig() throws IOException { try { systemConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(MessageFormat.format(JGitText .get().systemConfigFileInvalid, systemConfig.getFile() .getAbsolutePath(), e), e); } }
private void loadUserConfig() throws IOException { try { userConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(MessageFormat.format(JGitText .get().userConfigFileInvalid, userConfig.getFile() .getAbsolutePath(), e), e); } }
private AtomicFileCreation getAtomicFileCreationSupportOption( FileBasedConfig config) { try { config.load(); String value = config.getString(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_SUPPORTSATOMICFILECREATION); if (value == null) { return AtomicFileCreation.UNDEFINED; } return StringUtils.toBoolean(value) ? AtomicFileCreation.SUPPORTED : AtomicFileCreation.NOT_SUPPORTED; } catch (IOException | ConfigInvalidException e) { return AtomicFileCreation.SUPPORTED; } }
private void updateSslVerifyUser(boolean value) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { // Log it, but otherwise ignore here. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); } }
/** * Creates a {@link org.eclipse.jgit.transport.HttpConfig} that reads values * solely from the user config. * * @param uri * to get the configuration values for */ public HttpConfig(URIish uri) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); } catch (IOException | ConfigInvalidException e) { // Log it and then work with default values. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); init(new Config(), uri); return; } init(userConfig, uri); }
/** * Parse and load the repository specific configuration. * <p> * The default implementation reads {@code gitDir/config}, or returns an * empty configuration if gitDir was not set. * * @return the repository's configuration. * @throws java.io.IOException * the configuration is not available. */ protected Config loadConfig() throws IOException { if (getGitDir() != null) { // We only want the repository's configuration file, and not // the user file, as these parameters must be unique to this // repository and not inherited from other files. // File path = safeFS().resolve(getGitDir(), Constants.CONFIG); FileBasedConfig cfg = new FileBasedConfig(path, safeFS()); try { cfg.load(); } catch (ConfigInvalidException err) { throw new IllegalArgumentException(MessageFormat.format( JGitText.get().repositoryConfigFileInvalid, path .getAbsolutePath(), err.getMessage())); } return cfg; } else { return new Config(); } }
repo.getWorkTree(), Constants.DOT_GIT_MODULES), repo.getFS()); try { modulesConfig.load(); modulesConfig.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, name, ConfigConstants.CONFIG_KEY_PATH, path);
private void loadRepoConfig() throws IOException { try { repoConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(JGitText.get().unknownRepositoryFormat, e); } }
private void loadRepoConfig() throws IOException { try { repoConfig.load(); } catch (ConfigInvalidException e1) { IOException e2 = new IOException(JGitText.get().unknownRepositoryFormat); e2.initCause(e1); throw e2; } }
FileBasedConfig config = new FileBasedConfig(modulesFile, repository.getFS()); config.load(); modulesConfig = config; loadPathNames();
private void loadUserConfig() throws IOException { try { userConfig.load(); } catch (ConfigInvalidException e1) { IOException e2 = new IOException(MessageFormat.format(JGitText .get().userConfigFileInvalid, userConfig.getFile() .getAbsolutePath(), e1)); e2.initCause(e1); throw e2; } }
private void loadSystemConfig() throws IOException { try { systemConfig.load(); } catch (ConfigInvalidException e1) { IOException e2 = new IOException(MessageFormat.format(JGitText .get().systemConfigFileInvalid, systemConfig.getFile() .getAbsolutePath(), e1)); e2.initCause(e1); throw e2; } }
private void loadSystemConfig() throws IOException { try { systemConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(MessageFormat.format(JGitText .get().systemConfigFileInvalid, systemConfig.getFile() .getAbsolutePath(), e), e); } }
private void loadUserConfig() throws IOException { try { userConfig.load(); } catch (ConfigInvalidException e) { throw new IOException(MessageFormat.format(JGitText .get().userConfigFileInvalid, userConfig.getFile() .getAbsolutePath(), e), e); } }
private StoredConfig loadUserConfig() throws IOException { FileBasedConfig c = SystemReader.getInstance().openUserConfig(null, FS.DETECTED); try { c.load(); } catch (ConfigInvalidException e1) { throw new IOException(MessageFormat .format(LfsText.get().userConfigInvalid, c.getFile() .getAbsolutePath(), e1), e1); } return c; }
private AtomicFileCreation getAtomicFileCreationSupportOption( FileBasedConfig config) { try { config.load(); String value = config.getString(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_SUPPORTSATOMICFILECREATION); if (value == null) { return AtomicFileCreation.UNDEFINED; } return StringUtils.toBoolean(value) ? AtomicFileCreation.SUPPORTED : AtomicFileCreation.NOT_SUPPORTED; } catch (IOException | ConfigInvalidException e) { return AtomicFileCreation.SUPPORTED; } }
private void updateSslVerifyUser(boolean value) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { // Log it, but otherwise ignore here. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); } }
/** * Creates a {@link org.eclipse.jgit.transport.HttpConfig} that reads values * solely from the user config. * * @param uri * to get the configuration values for */ public HttpConfig(URIish uri) { FileBasedConfig userConfig = SystemReader.getInstance() .openUserConfig(null, FS.DETECTED); try { userConfig.load(); } catch (IOException | ConfigInvalidException e) { // Log it and then work with default values. LOG.error(MessageFormat.format(JGitText.get().userConfigFileInvalid, userConfig.getFile().getAbsolutePath(), e)); init(new Config(), uri); return; } init(userConfig, uri); }