如何在字符串列表中读取YAML

时间:2019-07-08 14:18:35

标签: spring-boot yaml

我的Spring应用程序有一个YAML文件。看起来像这样:

storages:
    file:
        local: 
          dir: file_storage
    http:
        local_host:
          url: http:*************
          client_id: *****
          secret_id: ******t
    ftp:
        ftp_server:
          path: ***********e

catalogues:
    database:
        local_database:
          host: jdbc:postgresql://l*****st:5432/ea******
          user: ***
          password: ***
          driver: org.postgresql.Driver
          maximum_pool_size: 3
    http:
        local_rest:
          url: http://localhost:1234/data

aliases:
    default_file_storage: local
    default_catalog: local_database
    a9c8662e-f4bc-4e8e-882d-310bf8e86198: local_database
    admin_catalog: local_database
    admin_storage : local

我需要将此数据作为application.properties中的字符串。我从Amazon的S3的外部存储下载属性。这些文件可以是application.properties格式或.yml格式

 storages.file.local.dir=file_storage
 storages.http. local_host.url=http:*************
 storages.http. local_host.client_id=http:*************
 storages.http. local_host.secret_id=http:*************

以此类推。

0 个答案:

没有答案
相关问题