/** * Checks if the provided resource meets the requirements to be created to CKAN. * * @throws Throwable if requirements aren't met */ private static void checkResource(CkanResourceMinimized resource) { checkNotNull(resource); checkNotNull(resource.getFormat(), "Ckan resource format must not be null!"); checkNotEmpty(resource.getName(), "Ckan resource name can't be empty!"); checkNotNull(resource.getDescription(), "Ckan resource description must not be null!"); // todo do we need to check mimetype?? checkNotNull(resource.getMimetype()); checkNotNull(resource.getPackageId(), "Ckan resource parent dataset must not be null!"); checkNotNull(resource.getUrl(), "Ckan resource url must not be null!"); }