當前位置: 首頁>>代碼示例>>Java>>正文


Java FS.DETECTED屬性代碼示例

本文整理匯總了Java中org.eclipse.jgit.util.FS.DETECTED屬性的典型用法代碼示例。如果您正苦於以下問題:Java FS.DETECTED屬性的具體用法?Java FS.DETECTED怎麽用?Java FS.DETECTED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.jgit.util.FS的用法示例。


在下文中一共展示了FS.DETECTED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: VirtualHostConfig

@Inject
VirtualHostConfig(SitePaths sitePaths) {
  File configFile = sitePaths.etc_dir.resolve("virtualhost.config").toFile();
  FileBasedConfig fileConfig = new FileBasedConfig(configFile, FS.DETECTED);
  config = fileConfig;
  try {
    fileConfig.load();
  } catch (IOException | ConfigInvalidException e) {
    log.error("Unable to open or parse " + configFile + ": virtual domains are disabled", e);
    enabled = false;
    defaultProjects = new String[0];
    return;
  }
  defaultProjects = config.getStringList("default", null, "projects");
  enabled = !config.getSubsections("server").isEmpty() || defaultProjects.length > 0;
}
 
開發者ID:GerritForge,項目名稱:gerrit-virtualhost,代碼行數:16,代碼來源:VirtualHostConfig.java

示例2: saveSecure

private static void saveSecure(final FileBasedConfig sec) throws IOException {
  if (FileUtil.modified(sec)) {
    final byte[] out = Constants.encode(sec.toText());
    final File path = sec.getFile();
    final LockFile lf = new LockFile(path, FS.DETECTED);
    if (!lf.lock()) {
      throw new IOException("Cannot lock " + path);
    }
    try {
      FileUtil.chmod(0600, new File(path.getParentFile(), path.getName()
          + ".lock"));
      lf.write(out);
      if (!lf.commit()) {
        throw new IOException("Cannot commit write to " + path);
      }
    } finally {
      lf.unlock();
    }
  }
}
 
開發者ID:dluksza,項目名稱:secure-store-jasypt,代碼行數:20,代碼來源:SecureStoreJasypt.java

示例3: getSecureStoreFromGerritConfig

private static String getSecureStoreFromGerritConfig(Path sitePath) {
  AbstractModule m =
      new AbstractModule() {
        @Override
        protected void configure() {
          bind(Path.class).annotatedWith(SitePath.class).toInstance(sitePath);
          bind(SitePaths.class);
        }
      };
  Injector injector = Guice.createInjector(m);
  SitePaths site = injector.getInstance(SitePaths.class);
  FileBasedConfig cfg = new FileBasedConfig(site.gerrit_config.toFile(), FS.DETECTED);
  if (!cfg.getFile().exists()) {
    return DefaultSecureStore.class.getName();
  }

  try {
    cfg.load();
    String className = cfg.getString("gerrit", null, "secureStoreClass");
    return nullToDefault(className);
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:24,代碼來源:GerritServerConfigModule.java

示例4: CiDataSourceProvider

@Inject
protected CiDataSourceProvider(SitePaths site,
    @PluginName String pluginName,
    @Nullable MetricMaker metrics,
    Context ctx,
    CiDataSourceType dst) {
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
  this.metrics = metrics;
  this.ctx = ctx;
  this.dst = dst;
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:18,代碼來源:CiDataSourceProvider.java

示例5: submoduleRemove

@Override
public void submoduleRemove(String folderName) {
    configRemoveSection(folderName);

    Repository repository = null;
    try {
        repository = getRepository(workingDir);

        StoredConfig gitSubmodulesConfig = new FileBasedConfig(null, new File(repository.getWorkTree(), Constants.DOT_GIT_MODULES), FS.DETECTED);
        gitSubmodulesConfig.unsetSection(ConfigConstants.CONFIG_SUBMODULE_SECTION, folderName);
        gitSubmodulesConfig.save();

        Git git = Git.wrap(repository);
        git.rm().setCached(true).addFilepattern(folderName).call();

        FileUtils.deleteQuietly(new File(workingDir, folderName));
    } catch (Exception e) {
        throw new RuntimeException("sub-module remove failed", e);
    } finally {
        if (repository != null) {
            repository.close();
        }
    }
}
 
開發者ID:gocd,項目名稱:go-plugins,代碼行數:24,代碼來源:JGitHelper.java

示例6: DevServer

DevServer(File cfgFile) throws IOException, ConfigInvalidException {
  sourceRoot = findSourceRoot();

  Config cfg = defaultConfig();
  if (cfgFile.exists() && cfgFile.isFile()) {
    FileBasedConfig fcfg = new FileBasedConfig(cfg, cfgFile, FS.DETECTED);
    fcfg.load();
    cfg = fcfg;
  } else {
    log.info("Config file {} not found, using defaults", cfgFile.getPath());
  }
  this.cfg = cfg;

  httpd = new Server();
  httpd.setConnectors(connectors());
  httpd.setThreadPool(threadPool());
  httpd.setHandler(handler());
}
 
開發者ID:afrojer,項目名稱:gitiles,代碼行數:18,代碼來源:DevServer.java

示例7: GitVersionControl

public GitVersionControl(Path path) throws IOException {
    try {
        // Cribbed from Git.open, but with findGitDir rather than setGitDir
        // and extracting the location.
        FS fs = FS.DETECTED;
        RepositoryCache.FileKey key = RepositoryCache.FileKey.lenient(path.toFile(), fs);
        RepositoryBuilder builder = new RepositoryBuilder()
                .setFS(fs)
                .findGitDir(key.getFile())
                .setMustExist(true);
        repositoryRoot = Paths.get(builder.getGitDir().getAbsolutePath()).getParent();
        repo = new Git(builder.build());

        checkMergeDriver(repositoryRoot);
    } catch (RuntimeException ex) {
        throw new IOException(ex);
    }
}
 
開發者ID:fuzzyBSc,項目名稱:systemdesign,代碼行數:18,代碼來源:GitVersionControl.java

示例8: testExtension

public void testExtension () throws Exception {
    // ping the factory
    FS fs = FS.DETECTED;
    Field f = FS.class.getDeclaredField("factory");
    f.setAccessible(true);
    FSFactory fact = (FSFactory) f.get(FS.class);
    assertEquals("org.eclipse.jgit.util.Java7FSFactory", fact.getClass().getName());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:CheckJava7ExtensionTest.java

示例9: run

@Override
public void run() throws Exception {
  File configFile = site.etc_dir.resolve(pluginName + ".config").toFile();
  if (!configFile.exists()) {
    return;
  }

  FileBasedConfig config = new FileBasedConfig(configFile, FS.DETECTED);
  config.load();
  for (String name : config.getSubsections("remote")) {
    if (!Strings.isNullOrEmpty(config.getString("remote", name, "rescheduleDelay"))) {
      continue;
    }

    int replicationDelay =
        config.getInt("remote", name, "replicationDelay", DEFAULT_REPLICATION_DELAY);
    if (replicationDelay > 0) {
      int delay = Math.max(replicationDelay, DEFAULT_RESCHEDULE_DELAY);
      ui.message("Setting remote.%s.rescheduleDelay = %d\n", name, delay);
      config.setInt("remote", name, "rescheduleDelay", delay);
    } else {
      ui.message(
          "INFO: Assuming default (%d s) for remote.%s.rescheduleDelay\n",
          DEFAULT_RESCHEDULE_DELAY, name);
    }
  }
  config.save();
}
 
開發者ID:GerritCodeReview,項目名稱:plugins_replication,代碼行數:28,代碼來源:Init.java

示例10: Derby

@Inject
Derby(SitePaths site,
    @PluginName String pluginName) {
  super("org.apache.derby.jdbc.EmbeddedDriver");
  this.site = site;
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:14,代碼來源:Derby.java

示例11: MySql

@Inject
public MySql(SitePaths site,
    @PluginName String pluginName) {
  super("com.mysql.jdbc.Driver");
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:13,代碼來源:MySql.java

示例12: H2

@Inject
H2(SitePaths site,
    @PluginName String pluginName) {
  super("org.h2.Driver");
  this.site = site;
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:14,代碼來源:H2.java

示例13: Oracle

@Inject
public Oracle(SitePaths site,
    @PluginName String pluginName) {
  super("oracle.jdbc.driver.OracleDriver");
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:13,代碼來源:Oracle.java

示例14: PostgreSQL

@Inject
public PostgreSQL(SitePaths site,
    @PluginName String pluginName) {
  super("org.postgresql.Driver");
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:13,代碼來源:PostgreSQL.java

示例15: CiDataSourceTypeGuesser

@Inject
CiDataSourceTypeGuesser(SitePaths site,
    @PluginName String pluginName) {
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
}
 
開發者ID:davido,項目名稱:gerrit-ci-plugin,代碼行數:12,代碼來源:CiDataSourceTypeGuesser.java


注:本文中的org.eclipse.jgit.util.FS.DETECTED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。