properties-file

    5热度

    3回答

    形势 我从的.properties注入性文件与@Value注释字段。然而这个属性提供了敏感的凭据,所以我将它们从存储库中删除我仍然希望如果有人想运行项目,并且没有带默认值将设置为字段的凭据的.properties文件。 问题 即使我设置默认值字段本身我得到异常,当属性文件不存在: org.springframework.beans.factory.BeanCreationException: Er

    0热度

    1回答

    我有一个属性文件这样的文件: [flags] prop1=value prop2=value [patterns] prop3=#.00 prop4=###,##0.00 [other] prop5=value 当我处理文件,不仅磅符号被转义(#),但我的所有属性都没有秩序。 我的代码是这样的: Properties props = new Properties(); Fil

    0热度

    1回答

    我创建了一个名为FileConfig与以下标注类: file.config.location = fileinfo.yaml 很显然,我的编译器说,该地区酒店:“application.properties”中存在 @ConfigurationProperties(locations = { "classpath:application.properties" , "${file.config

    0热度

    2回答

    如何写入或读取任何类型的文件(用于示例.txt文件)与config.property文件的资源文件夹关联,但不使用绝对路径文件。 我试图解决这个象下面这样: ClassLoader classLoader = Setting.class.getClassLoader(); Setting setting = new Setting(); try (InputStream resourceAs

    0热度

    5回答

    我有一个方法需要int[]作为输入。 methodABC(int[] nValue) 我想从Java属性文件 nValue=1,2,3 如何从配置文件读取这个还是我来存储这些不同的格式借此n值? 我想什么是(changing the nValue to 123 instead of 1,2,3): int nValue = Integer.parseInt(configuration.ge

    -3热度

    1回答

    所以我在java中有一个.properties文件。其中一个属性具有某种发生变化的路径的价值。 我所做的是编辑.properties文件以将值更改为新路径。不过,我似乎总是读旧的价值。 这可能是什么原因? 编辑 这是我读的属性文件 propertiesFilePath = "configs/index.properties"; Properties properties = new Propert

    0热度

    4回答

    我有以下部分的代码,其中粒度的值是块。当我比较这些值时,它总是显示NO。 System.out.println(granularity); System.out.println(granularity.equalsIgnoreCase("block")?"YES":"NO"); if(granularity.equalsIgnoreCase("BLOCK")){.....

    2热度

    1回答

    我有以下内容属性文件: INVALID_ARGUMENT=Field ${fieldName} is invalid or missing. 我读这使用Spring配置: @PropertySource("error_messages_en.properties") @Configuration public static class ErrorMessagesEn { @Val

    1热度

    2回答

    在我test.conf文件我有以下的配置 akka { actor { provider = "akka.cluster.ClusterActorRefProvider" serializers { java = "akka.serialization.JavaSerializer" } serialization-bindings

    -2热度

    1回答

    如何在使用ansibile脚本进行部署时更新spring的application.properties中的值。 我可以使用ansible的lineinfile模块并用正则表达式替换值。但我正在寻找更好的解决方案。 编辑:使用Ansible jinja模板是另一种解决方案。但是,无论何时我在spring的application.properties中使用它,我也应该将它添加到模板中。不过,我希望它在