From cb235b4dd68dccd0fceb451573aebb4137942385 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 10 Apr 2011 20:12:30 +0200 Subject: [PATCH] Add methods to delete a temporary image. --- .../java/net/pterodactylus/sone/core/Core.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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() { -- 2.7.4