当前位置: 首页>>代码示例>>Java>>正文


Java FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess方法代码示例

本文整理汇总了Java中org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess方法的典型用法代码示例。如果您正苦于以下问题:Java FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess方法的具体用法?Java FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess怎么用?Java FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean的用法示例。


在下文中一共展示了FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: freeMarkerConfiguration

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Bean
public FreeMarkerConfigurationFactoryBean freeMarkerConfiguration() {
    FreeMarkerConfigurationFactoryBean freeMarkerFactoryBean = new FreeMarkerConfigurationFactoryBean();
    freeMarkerFactoryBean.setTemplateLoaderPaths("classpath:/templates");
    freeMarkerFactoryBean.setPreferFileSystemAccess(true);
    freeMarkerFactoryBean.setDefaultEncoding("UTF-8");
    return freeMarkerFactoryBean;
}
 
开发者ID:QianmiOpen,项目名称:interface-test,代码行数:9,代码来源:InterfaceTestApplication.java

示例2: freemarkerConfiguration

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Bean
public freemarker.template.Configuration freemarkerConfiguration() {
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    return factoryBean.getObject();
}
 
开发者ID:alv-ch,项目名称:alv-ch-sysinfos.api,代码行数:8,代码来源:MailConfiguration.java

示例3: setup

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Before
public void setup() throws IOException, TemplateException {
    initMocks(this);
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    factoryBean.afterPropertiesSet();
    Configuration configuration = factoryBean.getObject();
    ReflectionTestUtils.setField(heatTemplateBuilder, "freemarkerConfiguration", configuration);
    ReflectionTestUtils.setField(heatTemplateBuilder, "openStackHeatTemplatePath", templatePath);

    stackName = "testStack";
    groups = new ArrayList<>(1);
    String name = "master";
    List<Volume> volumes = Arrays.asList(new Volume("/hadoop/fs1", "HDD", 1), new Volume("/hadoop/fs2", "HDD", 1));
    InstanceTemplate instanceTemplate = new InstanceTemplate("m1.medium", name, 0L, volumes, InstanceStatus.CREATE_REQUESTED,
            new HashMap<>(), 0L);
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    CloudInstance instance = new CloudInstance("SOME_ID", instanceTemplate, instanceAuthentication);
    List<SecurityRule> rules = Collections.singletonList(new SecurityRule("0.0.0.0/0",
            new PortDefinition[]{new PortDefinition("22", "22"), new PortDefinition("443", "443")}, "tcp"));
    Security security = new Security(rules, null);
    groups.add(new Group(name, InstanceGroupType.CORE, Collections.singletonList(instance), security, null,
            instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey()));
    Map<InstanceGroupType, String> userData = ImmutableMap.of(
            InstanceGroupType.CORE, "CORE",
            InstanceGroupType.GATEWAY, "GATEWAY"
    );
    Map<String, String> tags = new HashMap<>();
    tags.put(CloudbreakResourceType.DISK.templateVariable(), CloudbreakResourceType.DISK.key());
    tags.put(CloudbreakResourceType.INSTANCE.templateVariable(), CloudbreakResourceType.INSTANCE.key());
    tags.put(CloudbreakResourceType.IP.templateVariable(), CloudbreakResourceType.IP.key());
    tags.put(CloudbreakResourceType.NETWORK.templateVariable(), CloudbreakResourceType.NETWORK.key());
    tags.put(CloudbreakResourceType.SECURITY.templateVariable(), CloudbreakResourceType.SECURITY.key());
    tags.put(CloudbreakResourceType.STORAGE.templateVariable(), CloudbreakResourceType.STORAGE.key());
    tags.put(CloudbreakResourceType.TEMPLATE.templateVariable(), CloudbreakResourceType.TEMPLATE.key());
    when(defaultCostTaggingService.prepareInstanceTagging()).thenReturn(tags);
    image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "url", "default", null);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:40,代码来源:HeatTemplateBuilderTest.java

示例4: freemarkerConfiguration

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
Configuration freemarkerConfiguration() throws IOException, TemplateException {
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    factoryBean.afterPropertiesSet();
    return factoryBean.getObject();
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:8,代码来源:EmailSenderHostServiceTypeTest.java

示例5: setup

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Before
public void setup() throws IOException, TemplateException {
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    factoryBean.afterPropertiesSet();
    Configuration configuration = factoryBean.getObject();
    USER_DATA_BUILDER.setFreemarkerConfiguration(configuration);

    UserDataBuilderParams params = new UserDataBuilderParams();
    params.setCustomData("date >> /tmp/time.txt");

    ReflectionTestUtils.setField(USER_DATA_BUILDER, "userDataBuilderParams", params);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:15,代码来源:UserDataBuilderTest.java

示例6: setUp

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    initMocks(this);
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    factoryBean.afterPropertiesSet();
    Configuration configuration = factoryBean.getObject();
    ReflectionTestUtils.setField(cloudFormationTemplateBuilder, "freemarkerConfiguration", configuration);

    awsCloudFormationTemplate = configuration.getTemplate(templatePath, "UTF-8").toString();
    authenticatedContext = authenticatedContext();
    existingSubnetCidr = "testSubnet";

    name = "master";
    List<Volume> volumes = Arrays.asList(new Volume("/hadoop/fs1", "HDD", 1), new Volume("/hadoop/fs2", "HDD", 1));
    InstanceTemplate instanceTemplate = new InstanceTemplate("m1.medium", name, 0L, volumes, InstanceStatus.CREATE_REQUESTED,
            new HashMap<>(), 0L);
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    CloudInstance instance = new CloudInstance("SOME_ID", instanceTemplate, instanceAuthentication);
    List<SecurityRule> rules = Collections.singletonList(new SecurityRule("0.0.0.0/0",
            new PortDefinition[]{new PortDefinition("22", "22"), new PortDefinition("443", "443")}, "tcp"));
    Security security = new Security(rules, null);
    Map<InstanceGroupType, String> userData = ImmutableMap.of(
            InstanceGroupType.CORE, "CORE",
            InstanceGroupType.GATEWAY, "GATEWAY"
    );
    Image image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
    List<Group> groups = new ArrayList<>();
    groups.add(new Group(name, InstanceGroupType.CORE, Collections.singletonList(instance), security, null,
            instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey()));
    groups.add(new Group(name, InstanceGroupType.GATEWAY, Collections.singletonList(instance), security, null,
            instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey()));
    Network network = new Network(new Subnet("testSubnet"));
    Map<String, String> parameters = new HashMap<>();
    parameters.put("persistentStorage", "persistentStorageTest");
    parameters.put("attachedStorageOption", "attachedStorageOptionTest");
    Map<String, String> tags = new HashMap<>();
    tags.put("testtagkey", "testtagvalue");

    defaultTags.put(CloudbreakResourceType.DISK.templateVariable(), CloudbreakResourceType.DISK.key());
    defaultTags.put(CloudbreakResourceType.INSTANCE.templateVariable(), CloudbreakResourceType.INSTANCE.key());
    defaultTags.put(CloudbreakResourceType.IP.templateVariable(), CloudbreakResourceType.IP.key());
    defaultTags.put(CloudbreakResourceType.NETWORK.templateVariable(), CloudbreakResourceType.NETWORK.key());
    defaultTags.put(CloudbreakResourceType.SECURITY.templateVariable(), CloudbreakResourceType.SECURITY.key());
    defaultTags.put(CloudbreakResourceType.STORAGE.templateVariable(), CloudbreakResourceType.STORAGE.key());
    defaultTags.put(CloudbreakResourceType.TEMPLATE.templateVariable(), CloudbreakResourceType.TEMPLATE.key());
    cloudStack = new CloudStack(groups, network, image, parameters, tags, null,
            instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey());
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:51,代码来源:CloudFormationTemplateBuilderTest.java

示例7: setUp

import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    initMocks(this);
    FreeMarkerConfigurationFactoryBean factoryBean = new FreeMarkerConfigurationFactoryBean();
    factoryBean.setPreferFileSystemAccess(false);
    factoryBean.setTemplateLoaderPath("classpath:/");
    factoryBean.afterPropertiesSet();
    Configuration configuration = factoryBean.getObject();
    ReflectionTestUtils.setField(azureTemplateBuilder, "freemarkerConfiguration", configuration);
    ReflectionTestUtils.setField(azureTemplateBuilder, "armTemplatePath", templatePath);
    ReflectionTestUtils.setField(azureTemplateBuilder, "armTemplateParametersPath", "templates/parameters.ftl");
    Map<InstanceGroupType, String> userData = ImmutableMap.of(
            InstanceGroupType.CORE, CORE_CUSTOM_DATA,
            InstanceGroupType.GATEWAY, GATEWAY_CUSTOM_DATA
    );
    groups = new ArrayList<>();
    stackName = "testStack";
    name = "master";
    List<Volume> volumes = Arrays.asList(new Volume("/hadoop/fs1", "HDD", 1), new Volume("/hadoop/fs2", "HDD", 1));
    InstanceTemplate instanceTemplate = new InstanceTemplate("m1.medium", name, 0L, volumes, InstanceStatus.CREATE_REQUESTED,
            new HashMap<>(), 0L);
    Map<String, Object> params = new HashMap<>();
    params.put(CloudInstance.SUBNET_ID, "existingSubnet");
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication("sshkey", "", "cloudbreak");
    instance = new CloudInstance("SOME_ID", instanceTemplate, instanceAuthentication, params);
    List<SecurityRule> rules = Collections.singletonList(new SecurityRule("0.0.0.0/0",
            new PortDefinition[]{new PortDefinition("22", "22"), new PortDefinition("443", "443")}, "tcp"));
    security = new Security(rules, null);
    image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
    cloudContext = new CloudContext(7899L, "thisisaverylongazureresourcenamewhichneedstobeshortened", "dummy1", "dummy2", "test",
            Location.location(Region.region("EU"), new AvailabilityZone("availabilityZone")));
    azureCredentialView = new AzureCredentialView(cloudCredential("siq-haas"));
    azureStorageView = new AzureStorageView(azureCredentialView, cloudContext, azureStorage, null);

    azureSubnetStrategy = AzureSubnetStrategy.getAzureSubnetStrategy(FILL, Collections.singletonList("existingSubnet"),
            ImmutableMap.of("existingSubnet", 100));
    defaultTags.put(CloudbreakResourceType.DISK.templateVariable(), CloudbreakResourceType.DISK.key());
    defaultTags.put(CloudbreakResourceType.INSTANCE.templateVariable(), CloudbreakResourceType.INSTANCE.key());
    defaultTags.put(CloudbreakResourceType.IP.templateVariable(), CloudbreakResourceType.IP.key());
    defaultTags.put(CloudbreakResourceType.NETWORK.templateVariable(), CloudbreakResourceType.NETWORK.key());
    defaultTags.put(CloudbreakResourceType.SECURITY.templateVariable(), CloudbreakResourceType.SECURITY.key());
    defaultTags.put(CloudbreakResourceType.STORAGE.templateVariable(), CloudbreakResourceType.STORAGE.key());
    defaultTags.put(CloudbreakResourceType.TEMPLATE.templateVariable(), CloudbreakResourceType.TEMPLATE.key());
    reset(azureUtils);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:46,代码来源:AzureTemplateBuilderTest.java


注:本文中的org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean.setPreferFileSystemAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。