Mercurial > hg > mercurial
view mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/ServerPluginConfigImpl.java @ 408:b34ffc622efc Faradi-7.0.x
TW-20295 store log.template in the temp dir
author | Dmitry Neverov <dmitry.neverov@jetbrains.com> |
---|---|
date | Mon, 05 Mar 2012 10:42:02 +0400 |
parents | 092373ee11e5 |
children | 743dc1646555 |
line wrap: on
line source
package jetbrains.buildServer.buildTriggers.vcs.mercurial; import jetbrains.buildServer.serverSide.ServerPaths; import jetbrains.buildServer.serverSide.TeamCityProperties; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; /** * @author dmitry.neverov */ public class ServerPluginConfigImpl implements ServerPluginConfig { private static final String PULL_TIMEOUT_SECONDS = "teamcity.hg.pull.timeout.seconds"; public static final int DEFAULT_PULL_TIMEOUT_SECONDS = 3600; private final File myCachesDir; public ServerPluginConfigImpl(@NotNull final ServerPaths paths) { myCachesDir = new File(paths.getCachesDir(), "mercurial"); } public boolean isUsePullProtocol() { return TeamCityProperties.getBooleanOrTrue("teamcity.hg.use.pull.protocol"); } @Nullable public String getHgPath() { return TeamCityProperties.getPropertyOrNull("teamcity.hg.server.path"); } @NotNull public File getCachesDir() { return myCachesDir; } public int getPullTimeout() { int timeout = TeamCityProperties.getInteger(PULL_TIMEOUT_SECONDS, DEFAULT_PULL_TIMEOUT_SECONDS); return timeout > 0 ? timeout : DEFAULT_PULL_TIMEOUT_SECONDS; } }