本文整理汇总了Java中com.google.gerrit.server.config.SitePaths.resolve方法的典型用法代码示例。如果您正苦于以下问题:Java SitePaths.resolve方法的具体用法?Java SitePaths.resolve怎么用?Java SitePaths.resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gerrit.server.config.SitePaths
的用法示例。
在下文中一共展示了SitePaths.resolve方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: RulesCache
import com.google.gerrit.server.config.SitePaths; //导入方法依赖的package包/类
@Inject
protected RulesCache(
@GerritServerConfig Config config,
SitePaths site,
GitRepositoryManager gm,
DynamicSet<PredicateProvider> predicateProviders) {
maxDbSize = config.getInt("rules", null, "maxPrologDatabaseSize", 256);
maxSrcBytes = config.getInt("rules", null, "maxSourceBytes", 128 << 10);
enableProjectRules = config.getBoolean("rules", null, "enable", true) && maxSrcBytes > 0;
cacheDir = site.resolve(config.getString("cache", null, "directory"));
rulesDir = cacheDir != null ? cacheDir.resolve("rules") : null;
gitMgr = gm;
this.predicateProviders = predicateProviders;
systemLoader = getClass().getClassLoader();
defaultMachine = save(newEmptyMachine(systemLoader));
}
示例3: getCacheDir
import com.google.gerrit.server.config.SitePaths; //导入方法依赖的package包/类
private static Path getCacheDir(SitePaths site, String name) {
if (name == null) {
return null;
}
Path loc = site.resolve(name);
if (!Files.exists(loc)) {
try {
Files.createDirectories(loc);
} catch (IOException e) {
log.warn("Can't create disk cache: " + loc.toAbsolutePath());
return null;
}
}
if (!Files.isWritable(loc)) {
log.warn("Can't write to disk cache: " + loc.toAbsolutePath());
return null;
}
log.info("Enabling disk cache " + loc.toAbsolutePath());
return loc;
}
示例4: PrologCompiler
import com.google.gerrit.server.config.SitePaths; //导入方法依赖的package包/类
@Inject
PrologCompiler(
@GerritServerConfig Config config, SitePaths site, @Assisted Repository gitRepository) {
Path cacheDir = site.resolve(config.getString("cache", null, "directory"));
ruleDir = cacheDir != null ? cacheDir.resolve("rules") : null;
git = gitRepository;
}
示例5: LocalDiskRepositoryManager
import com.google.gerrit.server.config.SitePaths; //导入方法依赖的package包/类
@Inject
LocalDiskRepositoryManager(SitePaths site, @GerritServerConfig Config cfg) {
basePath = site.resolve(cfg.getString("gerrit", null, "basePath"));
if (basePath == null) {
throw new IllegalStateException("gerrit.basePath must be configured");
}
}
示例6: GitHubConfig
import com.google.gerrit.server.config.SitePaths; //导入方法依赖的package包/类
@Inject
public GitHubConfig(
@GerritServerConfig Config config,
final SitePaths site,
AllProjectsNameProvider allProjectsNameProvider,
CanonicalWebUrl canonicalWebUrl,
AuthConfig authConfig)
throws MalformedURLException {
super(config, canonicalWebUrl, authConfig);
String[] wizardFlows = config.getStringList(CONF_SECTION, null, CONF_WIZARD_FLOW);
for (String fromTo : wizardFlows) {
boolean redirect = fromTo.indexOf(FROM_TO_REDIRECT_SEPARATOR) > 0;
int sepPos = getSepPos(fromTo, redirect);
String fromPage = fromTo.substring(0, sepPos).trim();
NextPage toPage =
new NextPage(
fromTo.substring(sepPos + getSeparator(redirect).length() + 1).trim(), redirect);
wizardFromTo.put(fromPage, toPage);
}
jobPoolLimit = config.getInt(CONF_SECTION, CONF_JOB_POOL_LIMIT, 5);
jobExecTimeout = config.getInt(CONF_SECTION, CONF_JOB_EXEC_TIMEOUT, 10);
pullRequestListLimit = config.getInt(CONF_SECTION, CONF_PULL_REQUEST_LIST_LIMIT, 50);
repositoryListPageSize = config.getInt(CONF_SECTION, CONF_REPOSITORY_LIST_PAGE_SIZE, 50);
repositoryListLimit = config.getInt(CONF_SECTION, CONF_REPOSITORY_LIST_LIMIT, 50);
gitDir = site.resolve(config.getString("gerrit", null, "basePath"));
if (gitDir == null) {
throw new IllegalStateException("gerrit.basePath must be configured");
}
privateBaseProject = config.getString(CONF_SECTION, null, CONF_PRIVATE_BASE_PROJECT);
publicBaseProject = config.getString(CONF_SECTION, null, CONF_PUBLIC_BASE_PROJECT);
allProjectsName = allProjectsNameProvider.get().toString();
webhookSecret = config.getString(CONF_SECTION, null, CONF_WEBHOOK_SECRET);
webhookUser = config.getString(CONF_SECTION, null, CONF_WEBHOOK_USER);
}