refactor(stream): centralize stream directory resolution in DirectoryService
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user