简体   繁体   English

如何在clojure中读取属性文件,以便没有正文可以看到我的数据库密码

[英]how to read properties file in clojure so that there no body can see my data-base password

In java we read the properties file by Myclass.class.getProtectionDomain.getCodesource.getLocation.getPath() 在java中,我们通过Myclass.class.getProtectionDomain.getCodesource.getLocation.getPath()读取属性文件

But how this read in clojure 但这是如何读取clojure

Demo on different class: 不同课程的演示:

(def clazz clojure.lang.PersistentVector)
(.. clazz getProtectionDomain getCodeSource getLocation getPath)

You can also use ClojureWerkz's propertied library : http://blog.clojurewerkz.org/blog/2013/10/07/introducing-propertied/ 您还可以使用ClojureWerkz的有限库: http//blog.clojurewerkz.org/blog/2013/10/07/introducing-propertied/

Propertied is a tiny Clojure library that makes working with Java property lists from Clojure a bit nicer. Propertied是一个很小的Clojure库,可以让Clojure的Java属性列表更好一些。

It is very small in scope: convert java.util.Properties to and from an immutable map, load and store them to and from .properties files. 它的范围非常小:将java.util.Properties转换为不可变映射,然后将它们与.properties文件一起加载和存储。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM