(转载)https://bowerstudios.com/node/1066
Create the propertIEs object,and load it from the file system:PropertIEs props = new PropertIEs()
file propsfile = new file('/usr/local/etc/test.propertIEs')
props.load(propsfile.newDatainputStream())
Take a peek:println props.getProperty('porcupine')
Write a new random value and persist it to the file system:Integer rand = new Random().next(4)
props.setProperty('porcupine',rand.toString())
props.store(propsfile.newWriter(),null)
Peek again:props.load(propsfile.newDatainputStream())println props.getProperty('porcupine')
以上是内存溢出为你收集整理的Reading and Writing to a properties file - Groovy Example,在gradle文件中读写properties文件内容全部内容,希望文章能够帮你解决Reading and Writing to a properties file - Groovy Example,在gradle文件中读写properties文件内容所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)