Skip to content

Commit

Permalink
Merge pull request #70 from dbmdz/empty-uri-list-check
Browse files Browse the repository at this point in the history
Add check for empty uri list
  • Loading branch information
datazuul authored Mar 7, 2019
2 parents 03e380c + 53c4897 commit b7a9d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.w3c.dom.Document;
import org.xml.sax.SAXException;


public abstract class FileResourceRepositoryImpl implements FileResourceRepository {

private static final Logger LOGGER = LoggerFactory.getLogger(FileResourceRepositoryImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public FileResource create(String identifier, MimeType mimeType, boolean readOnl
resource.setUuid(UUID.randomUUID());

List<URI> uris = getUris(identifier, mimeType);
if (uris.isEmpty()) {
throw new ResourceIOException(String.format("FileResource with identifier %s and MimeType %s is not resolvable.", identifier, mimeType));
}
URI uri = uris.get(0);
resource.setUri(uri);

Expand Down

0 comments on commit b7a9d04

Please sign in to comment.