Skip to content

Commit 2e54fbb

Browse files
committed
move into javaai dir, add k8s and dockerfile and basicauth
1 parent 3231a49 commit 2e54fbb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

java-ai/src/main/java/oracleai/UploadDownloadImage.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import java.nio.file.Path;
1515
import java.nio.file.Paths;
1616

17-
import org.apache.commons.io.FileUtils;
1817
import org.springframework.http.MediaType;
1918

2019
@Controller
@@ -50,7 +49,7 @@ public ResponseEntity<String> uploadImage(@RequestParam("image") MultipartFile f
5049
}
5150

5251
try {
53-
FileUtils.forceMkdir(new File(DIRECTORY));
52+
org.apache.commons.io.FileUtils.forceMkdir(new File(DIRECTORY));
5453
Path path = Paths.get(DIRECTORY + file.getOriginalFilename());
5554
file.transferTo(path);
5655

@@ -64,7 +63,7 @@ public ResponseEntity<String> uploadImage(@RequestParam("image") MultipartFile f
6463
public ResponseEntity<byte[]> getImage(@PathVariable String filename) throws IOException {
6564
try {
6665
File file = new File(DIRECTORY, filename);
67-
byte[] fileContent = FileUtils.readFileToByteArray(file);
66+
byte[] fileContent = org.apache.commons.io.FileUtils.readFileToByteArray(file);
6867
return ResponseEntity.ok().contentType(MediaType.IMAGE_JPEG).body(fileContent);
6968
} catch (IOException e) {
7069
return ResponseEntity.notFound().build();

0 commit comments

Comments
 (0)