/** * Returns the BlobStoreConfiguration for the given Blob Store Name, if found in list of blob * store configurations. * * @param blobStoreName * @return * @throws IllegalArgumentException */ public BlobStoreConfiguration getConfiguration(final String blobStoreName) throws IllegalArgumentException { Assert.notNull(blobStoreName, "blobStoreName is null"); for (BlobStoreConfiguration c : getConfigs()) { if (c.containsBlobStore(blobStoreName)) { return c; } } throw new IllegalArgumentException( "No configuration found containing blob store " + blobStoreName); }
/** * Finds out which {@link BlobStoreConfiguration} contains the given blob store, removes it, and * saves the configuration. * * @param blobStoreName the name of the blob store to remove * @return true if the blob store was removed, false if it was not found. */ public synchronized void removeBlobStore(final String blobStoreName) throws IllegalArgumentException { for (BlobStoreConfiguration config : getConfigs()) { if (config.containsBlobStore(blobStoreName)) { config.removeBlobStore(blobStoreName); return; } } throw new NoSuchElementException( "No configuration found containing blob store " + blobStoreName); } /**