throw a EntryAlreadyExistsStoreException if a blob with the given id already exists

This commit is contained in:
Sebastian Sdorra
2012-12-07 14:25:55 +01:00
parent 202d1741cd
commit fe1621a9d3
4 changed files with 78 additions and 4 deletions

View File

@@ -116,9 +116,10 @@ public class FileBlobStore extends FileBasedStore<Blob> implements BlobStore
{
if (file.exists())
{
throw new StoreException("blob allready exists");
}
else if ( !file.createNewFile() )
throw new EntryAlreadyExistsStoreException(
"blob with id ".concat(id).concat(" allready exists"));
}
else if (!file.createNewFile())
{
throw new StoreException("could not create blob for id ".concat(id));
}