refactor(stream): centralize stream directory resolution in DirectoryService

This commit is contained in:
2026-06-20 18:38:47 +01:00
parent a0efa3eb8c
commit 7cee64beb3
2 changed files with 11 additions and 6 deletions

View File

@@ -23,6 +23,9 @@ public class DirectoryService {
@Value("${storage.outputs}")
private String outputDir;
@Value("${STREAM_DATA}")
private String streamDir;
@Value("${storage.temp.inputs}")
private String tempInputsDir;
@@ -77,6 +80,12 @@ public class DirectoryService {
return file;
}
public File getStreamDir(String streamKey) throws IOException {
File file = new File(streamDir + File.separator + streamKey);
createDirectory(file.getAbsolutePath());
return file;
}
public File getUserThumbnailsFile(Long userId, String filename) throws IOException {
if (filename == null || filename.isEmpty()) {
throw new IllegalArgumentException("File name cannot be null or empty");