forked from HH-RDR-AI/chainflow
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTestController.java
More file actions
29 lines (25 loc) · 1012 Bytes
/
TestController.java
File metadata and controls
29 lines (25 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.guru.engine.controller;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@RestController
@RequestMapping("/test")
public class TestController {
@GetMapping("/check-file")
public ResponseEntity<String> checkFile() {
try {
Resource resource = new ClassPathResource("static/openapi/openapi.json");
if (resource.exists()) {
return ResponseEntity.ok("File exists at: " + resource.getURL().toString());
} else {
return ResponseEntity.ok("File does not exist");
}
} catch (IOException e) {
return ResponseEntity.ok("Error checking file: " + e.getMessage());
}
}
}