From 202d1741cdc4866b6291f891132c2ecc9552fd65 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Fri, 7 Dec 2012 14:13:12 +0100 Subject: [PATCH] improve create method of blob store --- .../src/main/java/sonia/scm/store/FileBlobStore.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scm-dao-xml/src/main/java/sonia/scm/store/FileBlobStore.java b/scm-dao-xml/src/main/java/sonia/scm/store/FileBlobStore.java index 68c84c9b2d..df400bd5f8 100644 --- a/scm-dao-xml/src/main/java/sonia/scm/store/FileBlobStore.java +++ b/scm-dao-xml/src/main/java/sonia/scm/store/FileBlobStore.java @@ -114,7 +114,11 @@ public class FileBlobStore extends FileBasedStore implements BlobStore try { - if (!file.exists() &&!file.createNewFile()) + if (file.exists()) + { + throw new StoreException("blob allready exists"); + } + else if ( !file.createNewFile() ) { throw new StoreException("could not create blob for id ".concat(id)); }