|
@@ -27,7 +27,7 @@ public class RosController {
|
|
|
try {
|
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("config.yaml", "utf-8"));
|
|
|
- byte[] buffer = new byte[1024];
|
|
|
+ byte[] buffer = new byte[10000];
|
|
|
// org.springframework.core.io.Resource resource = resourceLoader.getResource("classpath:config.yaml");
|
|
|
// InputStream inputStream = resource.getInputStream();
|
|
|
InputStream inputStream = Files.newInputStream(Paths.get("/mnt/disk001/oss-config/yaml/config.yaml"));
|
|
@@ -41,16 +41,21 @@ public class RosController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/configString")
|
|
|
- public String configString(HttpServletResponse response) {
|
|
|
+ public String configString() {
|
|
|
try {
|
|
|
- response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("config.yaml", "utf-8"));
|
|
|
- byte[] buffer = new byte[1024];
|
|
|
-// org.springframework.core.io.Resource resource = resourceLoader.getResource("classpath:config.yaml");
|
|
|
-// InputStream inputStream = resource.getInputStream();
|
|
|
InputStream inputStream = Files.newInputStream(Paths.get("/mnt/disk001/oss-config/yaml/config.yaml"));
|
|
|
- return MyFileUtil.read(inputStream);
|
|
|
+ return MyFileUtil.read(inputStream, 10000);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ @GetMapping("/configString2")
|
|
|
+ public String configString2() {
|
|
|
+ try {
|
|
|
+ InputStream inputStream = Files.newInputStream(Paths.get("/mnt/disk001/oss-config/yaml/config2.yaml"));
|
|
|
+ return MyFileUtil.read(inputStream, 10000);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|