SHOW:
|
|
- or go back to the newest paste.
1 | package test; | |
2 | ||
3 | import java.io.IOException; | |
4 | import java.io.InputStream; | |
5 | ||
6 | import org.yaml.snakeyaml.Yaml; | |
7 | ||
8 | public class Main | |
9 | { | |
10 | public static void main (String[] args) throws IOException | |
11 | { | |
12 | Yaml yaml = new Yaml(); | |
13 | try (InputStream in = Main.class.getResourceAsStream("/config.yml")) | |
14 | { | |
15 | Object obj = yaml.load(in); | |
16 | System.out.println(obj.toString()); | |
17 | } | |
18 | } | |
19 | } | |
20 | ||
21 | //config.yml | |
22 | - | //{version=1.4, panelcode=2281337, password=cb08f874a1d78acbda3811776d947509, base={netdir=C://Adobe/net/, localdir=C://Adobe/local/, //usepass=false, user=student, pass=12345}, mysql={adress=123.456.678.123, database=database, port=3306, user=root, pass=test}} |
22 | + | version: 1.4 |
23 | panelcode: 2281337 | |
24 | password: cb08f874a1d78acbda3811776d947509 | |
25 | base: | |
26 | netdir: C://Adobe/net/ | |
27 | localdir: C://Adobe/local/ | |
28 | usepass: false | |
29 | user: student | |
30 | pass: 12345 | |
31 | mysql: | |
32 | adress: 123.456.678.123 | |
33 | database: database | |
34 | port: 3306 | |
35 | user: root | |
36 | pass: test | |
37 | ||
38 | //result | |
39 | {version=1.4, panelcode=2281337, password=cb08f874a1d78acbda3811776d947509, base={netdir=C://Adobe/net/, localdir=C://Adobe/local/, usepass=false, user=student, pass=12345}, mysql={adress=123.456.678.123, database=database, port=3306, user=root, pass=test}} |