-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize: upgrade some dependencies (#686)
- Loading branch information
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,24 @@ | |
*/ | ||
package org.apache.seata.config; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.file.Files; | ||
|
||
import org.apache.seata.model.E2EConfig; | ||
import org.apache.seata.model.E2EWrapper; | ||
import org.yaml.snakeyaml.LoaderOptions; | ||
import org.yaml.snakeyaml.Yaml; | ||
import org.yaml.snakeyaml.constructor.Constructor; | ||
|
||
import java.io.*; | ||
import java.nio.file.Files; | ||
|
||
/** | ||
* @author [email protected] | ||
*/ | ||
public class ConfigReader { | ||
public static E2EConfig readConfig(File configFile) throws IOException { | ||
Yaml yaml = new Yaml(new Constructor(E2EWrapper.class)); | ||
LoaderOptions loaderOptions = new LoaderOptions(); | ||
Yaml yaml = new Yaml(new Constructor(E2EWrapper.class, loaderOptions)); | ||
E2EWrapper e2EWrapper = new E2EWrapper(); | ||
InputStream inputStream = Files.newInputStream(configFile.toPath()); | ||
// 从YAML文件读取数据并转换为Java对象 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters