{"record":{"id":"baf25ba2b8c8443d","repo":"apereo/cas","slug":"provided-location-does-not-exist-and-is-empty","errorCode":null,"errorMessage":"Provided location does not exist and is empty","messagePattern":"Provided location does not exist and is empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java","lineNumber":63,"sourceCode":"\n    /**\n     * Null unknown resource.\n     */\n    public static final Resource NULL_RESOURCE = new DescriptiveResource(\"Unknown Resource\");\n\n    private static final String HTTP_URL_PREFIX = \"http\";\n    private static final String RESOURCE_URL_PREFIX = \"resource:\";\n\n    /**\n     * Gets resource from a String location.\n     *\n     * @param location the metadata location\n     * @return the resource from\n     * @throws IOException the exception\n     */\n    public static AbstractResource getRawResourceFrom(final @Nullable String location) throws IOException {\n        if (StringUtils.isBlank(location)) {\n            throw new IllegalArgumentException(\"Provided location does not exist and is empty\");\n        }\n        if (isUrl(location)) {\n            return new UrlResource(location);\n        }\n        if (isClasspathResource(location)) {\n            return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()));\n        }\n        return new FileSystemResource(Strings.CI.remove(location, FILE_URL_PREFIX));\n    }\n\n    /**\n     * Is classpath resource?.\n     *\n     * @param location the location\n     * @return true/false\n     */\n    public static boolean isClasspathResource(final String location) {\n        return StringUtils.isNotBlank(location) && location.toLowerCase(Locale.ENGLISH).startsWith(CLASSPATH_URL_PREFIX);","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java#L45-L81","documentation":"Generic input guard in resource resolution: getRawResourceFrom(location) was called with a null or blank location string. No resource can be constructed from an empty location, so IllegalArgumentException is thrown before any URL/classpath/file logic runs. The input at fault is the location string.","triggerScenarios":"Thrown at core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a non-empty location (classpath:, file:, http(s) URL, or filesystem path)","Check the configuration property that feeds this location — it is unset or empty","Guard callers with ResourceUtils.doesResourceExist or blank checks when location is optional"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}