Misleading exception parameter in getFileFromCollection

Steps to reproduce

getFileFromCollection(String collectionId, String fileName) in WorkingFileRepositoryImpl.java has this code:

directory = getCollectionDirectory(collectionId, false);
if (directory == null)
throw new NotFoundException(fileName);

This is misleading because the log error is then

org.opencastproject.util.NotFoundException: 175.mkv
at org.opencastproject.workingfilerepository.impl.WorkingFileRepositoryImpl.getFileFromCollection(WorkingFileRepositoryImpl.java:453)

but the NotFoundException refers to the path, not the filename.

So this should be:

throw new NotFoundException(collectionId);

and the exception below in the same function should also be amended to be more descriptive, e.g.:

if (!sourceFile.exists()) {
throw new NotFoundException(sourceFile);

if (!md5File.exists()) {
throw new NotFoundException(md5File);

Status

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Components

Fix versions

Affects versions

Priority

Major
Configure