本文整理汇总了Java中jetbrains.buildServer.util.FileUtil.copyResourceIfNotExists方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.copyResourceIfNotExists方法的具体用法?Java FileUtil.copyResourceIfNotExists怎么用?Java FileUtil.copyResourceIfNotExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jetbrains.buildServer.util.FileUtil
的用法示例。
在下文中一共展示了FileUtil.copyResourceIfNotExists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VSONotificatorConfig
import jetbrains.buildServer.util.FileUtil; //导入方法依赖的package包/类
public VSONotificatorConfig(@NotNull ServerPaths serverPaths) throws IOException {
final File configDir = new File(serverPaths.getConfigDir(), FreeMarkerHelper.TEMPLATES_ROOT + "/" + Constants.NOTIFICATOR_TYPE);
configDir.mkdirs();
myConfigFile = new File(configDir, CONFIG_FILENAME);
FileUtil.copyResourceIfNotExists(getClass(), "/message_templates/" + CONFIG_FILENAME, myConfigFile);
reloadConfiguration();
copyMessageTemplates(configDir);
myChangeObserver = new FileWatcher(myConfigFile);
myChangeObserver.setSleepingPeriod(10000);
myChangeObserver.registerListener(this);
myChangeObserver.start();
myConfiguration = FreeMarkerHelper.getConfiguration(serverPaths);
}
示例2: reloadConfiguration
import jetbrains.buildServer.util.FileUtil; //导入方法依赖的package包/类
private void reloadConfiguration() {
Loggers.ACTIVITIES.info("Loading configuration file: " + this.myConfigFile.getAbsolutePath());
myConfigDir.mkdirs();
FileUtil.copyResourceIfNotExists(getClass(), "/config_templates/msteams-config.xml", new File(this.myConfigDir, "msteams-config.xml"));
Document document = parseFile(this.myConfigFile);
if (document != null)
{
Element rootElement = document.getRootElement();
readConfigurationFromXmlElement(rootElement);
}
}
示例3: reloadConfiguration
import jetbrains.buildServer.util.FileUtil; //导入方法依赖的package包/类
private void reloadConfiguration() {
Loggers.ACTIVITIES.info("Loading configuration file: " + this.myConfigFile.getAbsolutePath());
myConfigDir.mkdirs();
FileUtil.copyResourceIfNotExists(getClass(), "/config_templates/yammer-config.xml", new File(this.myConfigDir, "yammer-config.xml"));
Document document = parseFile(this.myConfigFile);
if (document != null)
{
Element rootElement = document.getRootElement();
readConfigurationFromXmlElement(rootElement);
}
}
示例4: reloadConfiguration
import jetbrains.buildServer.util.FileUtil; //导入方法依赖的package包/类
private void reloadConfiguration() {
Loggers.ACTIVITIES.info("Loading configuration file: " + this.myConfigFile.getAbsolutePath());
myConfigDir.mkdirs();
FileUtil.copyResourceIfNotExists(getClass(), "/config_templates/slack-config.xml", new File(this.myConfigDir, "slack-config.xml"));
Document document = parseFile(this.myConfigFile);
if (document != null)
{
Element rootElement = document.getRootElement();
readConfigurationFromXmlElement(rootElement);
}
}
示例5: copyResourceIfNotExists
import jetbrains.buildServer.util.FileUtil; //导入方法依赖的package包/类
private void copyResourceIfNotExists(@NotNull Path configDir, @NotNull String name) {
FileUtil.copyResourceIfNotExists(this.getClass(),
"/telegram_templates/" + name, configDir.resolve(name).toFile());
}