private boolean createResource(String workspace, StoreType dsType, String storeName,
            GSResourceEncoder re) throws IllegalArgumentException {
        if (workspace == null || dsType == null || storeName == null || re == null) {
            throw new IllegalArgumentException("Null argument");
        }
        StringBuilder sbUrl = new StringBuilder(restURL).append("/rest/workspaces/")
                .append(workspace).append("/").append(dsType).append("/").append(storeName)
                .append("/").append(dsType.getTypeNameWithFormat(Format.XML));

        final String resourceName = re.getName();
        if (resourceName == null) {
            throw new IllegalArgumentException(
                    "Unable to configure a coverage using unnamed coverage encoder");
        }

        final String xmlBody = re.toString();
        final String sendResult = HTTPUtils.postXml(sbUrl.toString(), xmlBody, gsuser, gspass);
        if (sendResult != null) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug(dsType + " successfully created " + workspace + ":" + storeName + ":"
                        + resourceName);
            }
        } else {
            if (LOGGER.isErrorEnabled())
                LOGGER.error("Error creating coverage " + workspace + ":" + storeName + ":"
                        + resourceName + " (" + sendResult + ")");
        }

        return sendResult != null;
    }