• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SitePaths类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gerrit.server.config.SitePaths的典型用法代码示例。如果您正苦于以下问题:Java SitePaths类的具体用法?Java SitePaths怎么用?Java SitePaths使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SitePaths类属于com.google.gerrit.server.config包,在下文中一共展示了SitePaths类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: VirtualHostConfig

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:17,代码来源:VirtualHostConfig.java


示例2: CiDataSourceProvider

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:19,代码来源:CiDataSourceProvider.java


示例3: createDataSource

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
private static DataSource createDataSource(
    Config cfg, SitePaths sitePaths, ThreadSettingsConfig threadSettingsConfig) {
  BasicDataSource datasource = new BasicDataSource();
  String url = getUrl(cfg, sitePaths);
  int poolLimit = threadSettingsConfig.getDatabasePoolLimit();
  datasource.setUrl(url);
  datasource.setDriverClassName(getDriverFromUrl(url));
  datasource.setMaxActive(cfg.getInt(ACCOUNT_PATCH_REVIEW_DB, "poolLimit", poolLimit));
  datasource.setMinIdle(cfg.getInt(ACCOUNT_PATCH_REVIEW_DB, "poolminidle", 4));
  datasource.setMaxIdle(
      cfg.getInt(ACCOUNT_PATCH_REVIEW_DB, "poolmaxidle", Math.min(poolLimit, 16)));
  datasource.setInitialSize(datasource.getMinIdle());
  datasource.setMaxWait(
      ConfigUtil.getTimeUnit(
          cfg,
          ACCOUNT_PATCH_REVIEW_DB,
          null,
          "poolmaxwait",
          MILLISECONDS.convert(30, SECONDS),
          MILLISECONDS));
  long evictIdleTimeMs = 1000L * 60;
  datasource.setMinEvictableIdleTimeMillis(evictIdleTimeMs);
  datasource.setTimeBetweenEvictionRunsMillis(evictIdleTimeMs / 2);
  return datasource;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:JdbcAccountPatchReviewStore.java


示例4: createAccountPatchReviewStore

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
public static JdbcAccountPatchReviewStore createAccountPatchReviewStore(
    Config cfg, SitePaths sitePaths, ThreadSettingsConfig threadSettingsConfig) {
  String url = cfg.getString(ACCOUNT_PATCH_REVIEW_DB, null, URL);
  if (url == null || url.contains(H2_DB)) {
    return new H2AccountPatchReviewStore(cfg, sitePaths, threadSettingsConfig);
  }
  if (url.contains(POSTGRESQL)) {
    return new PostgresqlAccountPatchReviewStore(cfg, sitePaths, threadSettingsConfig);
  }
  if (url.contains(MYSQL)) {
    return new MysqlAccountPatchReviewStore(cfg, sitePaths, threadSettingsConfig);
  }
  if (url.contains(MARIADB)) {
    return new MariaDBAccountPatchReviewStore(cfg, sitePaths, threadSettingsConfig);
  }
  throw new IllegalArgumentException(
      "unsupported driver type for account patch reviews db: " + url);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:19,代码来源:JdbcAccountPatchReviewStore.java


示例5: LuceneProjectIndex

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
LuceneProjectIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Provider<ProjectCache> projectCache,
    @Assisted Schema<ProjectData> schema)
    throws IOException {
  super(
      schema,
      sitePaths,
      dir(schema, cfg, sitePaths),
      PROJECTS,
      null,
      new GerritIndexWriterConfig(cfg, PROJECTS),
      new SearcherFactory());
  this.projectCache = projectCache;

  indexWriterConfig = new GerritIndexWriterConfig(cfg, PROJECTS);
  queryBuilder = new QueryBuilder<>(schema, indexWriterConfig.getAnalyzer());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:LuceneProjectIndex.java


示例6: AbstractElasticIndex

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
AbstractElasticIndex(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    Schema<V> schema,
    JestClientBuilder clientBuilder,
    String indexName) {
  this.sitePaths = sitePaths;
  this.schema = schema;
  this.gson = new GsonBuilder().setFieldNamingPolicy(LOWER_CASE_WITH_UNDERSCORES).create();
  this.queryBuilder = new ElasticQueryBuilder();
  this.indexName =
      String.format(
          "%s%s%04d",
          Strings.nullToEmpty(cfg.getString("elasticsearch", null, "prefix")),
          indexName,
          schema.getVersion());
  this.client = clientBuilder.build();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:19,代码来源:AbstractElasticIndex.java


示例7: DatabasePubKeyAuth

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
DatabasePubKeyAuth(
    SshKeyCacheImpl skc,
    SshLog l,
    IdentifiedUser.GenericFactory uf,
    PeerDaemonUser.Factory pf,
    SitePaths site,
    KeyPairProvider hostKeyProvider,
    @GerritServerConfig Config cfg,
    SshScope s) {
  sshKeyCache = skc;
  sshLog = l;
  userFactory = uf;
  peerFactory = pf;
  config = cfg;
  sshScope = s;
  myHostKeys = myHostKeys(hostKeyProvider);
  peerKeyCache = new PeerKeyCache(site.peer_keys);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:DatabasePubKeyAuth.java


示例8: getRobotsTxtServlet

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Provides
@Singleton
@Named(ROBOTS_TXT_SERVLET)
HttpServlet getRobotsTxtServlet(
    @GerritServerConfig Config cfg,
    SitePaths sitePaths,
    @Named(CACHE) Cache<Path, Resource> cache) {
  Path configPath = sitePaths.resolve(cfg.getString("httpd", null, "robotsFile"));
  if (configPath != null) {
    if (exists(configPath) && isReadable(configPath)) {
      return new SingleFileServlet(cache, configPath, true);
    }
    log.warn("Cannot read httpd.robotsFile, using default");
  }
  Paths p = getPaths();
  if (p.warFs != null) {
    return new SingleFileServlet(cache, p.warFs.getPath("/robots.txt"), false);
  }
  return new SingleFileServlet(cache, webappSourcePath("robots.txt"), true);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:StaticModule.java


示例9: VersionManager

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
protected VersionManager(
    SitePaths sitePaths,
    DynamicSet<OnlineUpgradeListener> listeners,
    Collection<IndexDefinition<?, ?, ?>> defs,
    boolean onlineUpgrade) {
  this.sitePaths = sitePaths;
  this.listeners = listeners;
  this.defs = Maps.newHashMapWithExpectedSize(defs.size());
  for (IndexDefinition<?, ?, ?> def : defs) {
    this.defs.put(def.getName(), def);
  }

  this.reindexers = Maps.newHashMapWithExpectedSize(defs.size());
  this.onlineUpgrade = onlineUpgrade;
  this.runReindexMsg =
      "No index versions for index '%s' ready; run java -jar "
          + sitePaths.gerrit_war.toAbsolutePath()
          + " reindex --index %s";
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:VersionManager.java


示例10: AutoReloadSecureCredentialsFactoryDecorator

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
public AutoReloadSecureCredentialsFactoryDecorator(
    SitePaths site, ReplicationFileBasedConfig config)
    throws ConfigInvalidException, IOException {
  this.site = site;
  this.config = config;
  this.secureCredentialsFactory = new AtomicReference<>(new SecureCredentialsFactory(site));
  this.secureCredentialsFactoryLoadTs = getSecureConfigLastEditTs();
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:10,代码来源:AutoReloadSecureCredentialsFactoryDecorator.java


示例11: AutoReloadConfigDecorator

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
public AutoReloadConfigDecorator(
    SitePaths site, WorkQueue workQueue, DestinationFactory destinationFactory)
    throws ConfigInvalidException, IOException {
  this.site = site;
  this.destinationFactory = destinationFactory;
  this.currentConfig = loadConfig();
  this.currentConfigTs = getLastModified(currentConfig);
  this.workQueue = workQueue;
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:11,代码来源:AutoReloadConfigDecorator.java


示例12: ReplicationFileBasedConfig

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
public ReplicationFileBasedConfig(SitePaths site, DestinationFactory destinationFactory)
    throws ConfigInvalidException, IOException {
  this.cfgPath = site.etc_dir.resolve("replication.config");
  this.config = new FileBasedConfig(cfgPath.toFile(), FS.DETECTED);
  this.destinations = allDestinations(destinationFactory);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:8,代码来源:ReplicationFileBasedConfig.java


示例13: InitPlugin

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
InitPlugin(Section.Factory sections,
    @PluginName String pluginName,
    ConsoleUI ui,
    SitePaths site,
    Injector parent) {
  this.ui = ui;
  this.site = site;
  this.configSection = sections.get("plugin", pluginName);
  this.parent = parent;
}
 
开发者ID:davido,项目名称:gerrit-ci-plugin,代码行数:12,代码来源:InitPlugin.java


示例14: Derby

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:15,代码来源:Derby.java


示例15: setUp

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
  site = new SitePaths(TempFileUtil.createTempDirectory().toPath());
  site.resolve("git").toFile().mkdir();
  cfg = new Config();
  cfg.setString("gerrit", null, "basePath", "git");
  configMock = createNiceMock(RepositoryConfig.class);
  expect(configMock.getAllBasePaths()).andReturn(new ArrayList<Path>()).anyTimes();
  replay(configMock);
  repoManager = new MultiBaseLocalDiskRepositoryManager(site, cfg, configMock);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:MultiBaseLocalDiskRepositoryManagerTest.java


示例16: H2

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:15,代码来源:H2.java


示例17: PostgreSQL

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:14,代码来源:PostgreSQL.java


示例18: CiDataSourceTypeGuesser

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@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,代码行数:13,代码来源:CiDataSourceTypeGuesser.java


示例19: dir

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
private static Directory dir(Schema<AccountState> schema, Config cfg, SitePaths sitePaths)
    throws IOException {
  if (LuceneIndexModule.isInMemoryTest(cfg)) {
    return new RAMDirectory();
  }
  Path indexDir = LuceneVersionManager.getDir(sitePaths, ACCOUNTS, schema);
  return FSDirectory.open(indexDir);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:LuceneAccountIndex.java


示例20: JobsServlet

import com.google.gerrit.server.config.SitePaths; //导入依赖的package包/类
@Inject
public JobsServlet(final ProjectControl.Factory projectControlFactory,
                   final GerritConfig gerritConfig, @CanonicalWebUrl String canonicalWebUrl,
                   final SitePaths sitePaths) {
    this.projectControlFactory = projectControlFactory;
    this.gerritConfig = gerritConfig;
    this.canonicalWebUrl = canonicalWebUrl;
    this.sitePaths = sitePaths;
}
 
开发者ID:palantir,项目名称:gerrit-ci,代码行数:10,代码来源:JobsServlet.java



注:本文中的com.google.gerrit.server.config.SitePaths类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Supplier类代码示例发布时间:2022-05-22
下一篇:
Java Flash类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap