RENAME methods for consistency
This commit is contained in:
@@ -21,7 +21,18 @@ public class DownloadService {
|
||||
this.jobService = jobService;
|
||||
}
|
||||
|
||||
public Resource download(String uuid) {
|
||||
public Resource downloadInput(String uuid) {
|
||||
Job job = jobService.get(uuid);
|
||||
|
||||
if (job == null) {
|
||||
throw new JobNotFound("Job doesn't exist");
|
||||
}
|
||||
|
||||
File file = job.getInputFile();
|
||||
return new FileSystemResource(file);
|
||||
}
|
||||
|
||||
public Resource downloadOutput(String uuid) {
|
||||
Job job = jobService.get(uuid);
|
||||
|
||||
if (job == null) {
|
||||
|
||||
@@ -17,22 +17,18 @@ public class EditService {
|
||||
public void edit(String uuid, ClipConfig clipConfig) {
|
||||
Job job = jobService.get(uuid);
|
||||
|
||||
if (clipConfig.getStartPoint() != null) {
|
||||
if (clipConfig.getStartPoint() < 0) {
|
||||
throw new IllegalArgumentException("Start point cannot be negative");
|
||||
}
|
||||
if (clipConfig.getStartPoint() != null && clipConfig.getStartPoint() < 0) {
|
||||
throw new IllegalArgumentException("Start point cannot be negative");
|
||||
}
|
||||
|
||||
if (clipConfig.getFileSize() != null) {
|
||||
if (clipConfig.getFileSize() < 100) {
|
||||
throw new IllegalArgumentException("File size cannot be less than 100kb");
|
||||
}
|
||||
if (clipConfig.getFileSize() != null && clipConfig.getFileSize() < 100) {
|
||||
throw new IllegalArgumentException("File size cannot be less than 100kb");
|
||||
}
|
||||
|
||||
job.setClipConfig(clipConfig);
|
||||
}
|
||||
|
||||
public void jobReady(String uuid) {
|
||||
public void process(String uuid) {
|
||||
jobService.jobReady(uuid);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ public class JobService {
|
||||
try {
|
||||
compressionService.run(job);// Execute the task
|
||||
} catch (IOException | InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
logger.error("Error while running job {}", job.getUuid(), e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user