Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileBasedConfig


   */
  public SubmoduleWalk loadModulesConfig() throws IOException, ConfigInvalidException {
    if (rootTree == null) {
      File modulesFile = new File(repository.getWorkTree(),
          Constants.DOT_GIT_MODULES);
      FileBasedConfig config = new FileBasedConfig(modulesFile,
          repository.getFS());
      config.load();
      modulesConfig = config;
    } else {
      TreeWalk configWalk = new TreeWalk(repository);
      try {
        configWalk.addTree(rootTree);
View Full Code Here


  }

  @Override
  public SubmoduleWalk loadModulesConfig() throws IOException, ConfigInvalidException {
    File modulesFile = new File(repository.getWorkTree(), Constants.DOT_GIT_MODULES);
    FileBasedConfig config = new FileBasedConfig(modulesFile, repository.getFS()) {
      @Override
      protected byte[] readFully() throws IOException {
        return submodulesConfig;
      }
    };
    config.load();
    setModulesConfig(config);
    return this;
  }
View Full Code Here

      // 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()));
      }
View Full Code Here

  private void loadModulesConfig() throws IOException, ConfigInvalidException {
    if (modulesConfig == null) {
      File modulesFile = new File(repository.getWorkTree(),
          Constants.DOT_GIT_MODULES);
      FileBasedConfig config = new FileBasedConfig(modulesFile,
          repository.getFS());
      config.load();
      modulesConfig = config;
    }
  }
View Full Code Here

  private ConfigurationEditorComponent createConfigurationEditor(final Repository repository) {
    StoredConfig repositoryConfig;
    if (repository.getConfig() instanceof FileBasedConfig) {
      File configFile = ((FileBasedConfig) repository.getConfig()).getFile();
      repositoryConfig = new FileBasedConfig(configFile, repository
          .getFS());
      repositoryConfig.addChangeListener(new ConfigChangedListener() {

        public void onConfigChanged(ConfigChangedEvent event) {
          repository.getListenerList().dispatch(
View Full Code Here

    systemConfig = SystemReader.getInstance().openSystemConfig(null, FS.DETECTED);
    userHomeConfig = SystemReader.getInstance().openUserConfig(null, FS.DETECTED);

    if (effectiveConfig instanceof FileBasedConfig) {
      File configFile = ((FileBasedConfig) effectiveConfig).getFile();
      repositoryConfig = new FileBasedConfig(configFile, repository
          .getFS());
    } else {
      repositoryConfig = effectiveConfig;
    }
View Full Code Here

      return displayArea;

    StoredConfig config = repo.getConfig();
    if (config instanceof FileBasedConfig) {
      File configFile = ((FileBasedConfig) config).getFile();
      config = new FileBasedConfig(configFile, repo.getFS());
      config.addChangeListener(new ConfigChangedListener() {

        public void onConfigChanged(ConfigChangedEvent event) {
          repo.fireEvent(new ConfigChangedEvent());
        }
View Full Code Here

    try {
      editableConfig.load();
      tv.setInput(new GitConfig(editableConfig));
      editable = true;
      if (editableConfig instanceof FileBasedConfig) {
        FileBasedConfig fileConfig = (FileBasedConfig) editableConfig;
        File configFile = fileConfig.getFile();
        if (configFile != null)
          if (isWriteable(configFile))
            location.setText(configFile.getPath());
          else {
            location.setText(NLS
View Full Code Here

    subRepo.close();

    String newUri = "git://server/repo.git";
    File modulesFile = new File(repo.getWorkTree(),
        Constants.DOT_GIT_MODULES);
    FileBasedConfig config = new FileBasedConfig(modulesFile, repo.getFS());
    config.load();
    config.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
        ConfigConstants.CONFIG_KEY_URL, newUri);
    config.save();

    assertEquals(
        uri,
        repo.getConfig().getString(
            ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
View Full Code Here

      // 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()));
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.FileBasedConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.