From: David ‘Bombe’ Roden Date: Sun, 10 Apr 2011 18:12:30 +0000 (+0200) Subject: Add methods to delete a temporary image. X-Git-Tag: beta-freefall-0.6.2-1~52 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cb235b4dd68dccd0fceb451573aebb4137942385;p=Sone.git Add methods to delete a temporary image. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 70c0e7e..09b0cbf 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1811,6 +1811,30 @@ public class Core implements IdentityListener, UpdateListener { } /** + * Deletes the given temporary image. + * + * @param temporaryImage + * The temporary image to delete + */ + public void deteleTemporaryImage(TemporaryImage temporaryImage) { + Validation.begin().isNotNull("Temporary Image", temporaryImage).check(); + deleteTemporaryImage(temporaryImage.getId()); + } + + /** + * Deletes the temporary image with the given ID. + * + * @param imageId + * The ID of the temporary image to delete + */ + public void deleteTemporaryImage(String imageId) { + Validation.begin().isNotNull("Temporary Image ID", imageId).check(); + synchronized (temporaryImages) { + temporaryImages.remove(imageId); + } + } + + /** * Starts the core. */ public void start() {