commons-configuration自定义配置文件

发布于 2024-10-04 10:42:39 字数 244 浏览 0 评论 0原文

我会将配置保存为列表,例如: 152.158.1545.415:80 好的 152.108.145.415:80 152.158.115.415:80 500

代替:

proxy= 152.108.145.415:80 代理= 152.108.145.415:80 ... 并阅读它。 ( 152.108.145.415 作为字符串 80 作为数字)。 我可以在这个库(commons-configuration)中进行这样的定制吗?

I'd to save configuration as a list of sth like:
152.158.1545.415:80 Ok
152.108.145.415:80
152.158.115.415:80 500

instead of:

proxy= 152.108.145.415:80
proxy= 152.108.145.415:80
...
and read it. ( 152.108.145.415 as a string 80 as a number ).
Can I do such a customisation in this library (commons-configuration)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月静好 2024-10-11 10:42:39

如果您使用 PropertiesConfiguration,您可以自定义“proxy”属性的布局,并将值放在一行中,如下所示:

proxy=152.158.115.415:80,152.158.115.415:80,152.158.115.415:80 

您可以通过调用以下命令来执行此操作:

configuration.getLayout().setSingleLine("proxy", true);

If you are using a PropertiesConfiguration you can customize the layout for the "proxy" property and have the values on a single line like this:

proxy=152.158.115.415:80,152.158.115.415:80,152.158.115.415:80 

You do this by calling:

configuration.getLayout().setSingleLine("proxy", true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文