private boolean removeStore(String workspace, String storename, StoreType type,
            final boolean recurse, final Purge purge) throws IllegalArgumentException {
        try {
            if (workspace == null || storename == null)
                throw new IllegalArgumentException("Arguments may not be null!");
            if (workspace.isEmpty() || storename.isEmpty())
                throw new IllegalArgumentException("Arguments may not be empty!");

            final StringBuilder url = new StringBuilder(restURL);
            url.append("/rest/workspaces/").append(workspace).append("/").append(type).append("/")
                    .append(storename);
            url.append("?recurse=").append(recurse);
            if(purge != null)
                url.append("&purge=").append(purge);

            final URL deleteStore = new URL(url.toString());

            boolean deleted = HTTPUtils.delete(deleteStore.toExternalForm(), gsuser, gspass);
            if (!deleted) {
                LOGGER.warn("Could not delete store " + workspace + ":" + storename);
            } else {
                LOGGER.info("Store successfully deleted " + workspace + ":" + storename);
            }

            return deleted;
        } catch (MalformedURLException ex) {
            if (LOGGER.isErrorEnabled())
                LOGGER.error(ex.getLocalizedMessage(), ex);
            return false;
        }
    }