- /**
- * Returns the album with the given ID, creating a new album if no album
- * with the given ID can be found.
- *
- * @param albumId
- * The ID of the album
- * @return The album with the given ID
- */
- public Album getAlbum(String albumId) {
- return getAlbum(albumId, true);
- }
-
- /**
- * Returns the album with the given ID, optionally creating a new album if
- * an album with the given ID can not be found.
- *
- * @param albumId
- * The ID of the album
- * @param create
- * {@code true} to create a new album if none exists for the
- * given ID
- * @return The album with the given ID, or {@code null} if no album with the
- * given ID exists and {@code create} is {@code false}
- */
- public Album getAlbum(String albumId, boolean create) {
- synchronized (albums) {
- Album album = albums.get(albumId);
- if (create && (album == null)) {
- album = new Album(albumId);
- albums.put(albumId, album);
- }
- return album;
- }
- }
-
- /**
- * Returns the image with the given ID, creating it if necessary.
- *
- * @param imageId
- * The ID of the image
- * @return The image with the given ID
- */
- public Image getImage(String imageId) {
- return getImage(imageId, true);