Skip to content

Commit

Permalink
#27 minor
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Sep 2, 2024
1 parent 1c987b3 commit 162c745
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ public static URL findWebRoot() throws MalformedURLException {
*/
@NotNull
public static File findResourcesJarOrFolder(@NotNull URL webRoot) throws IOException {
// we know that the `webapp` folder is somewhere on classpath, and webRoot parameter is pointing to it.
// we need to figure out where exactly on the filesystem the folder is.
final File file = FileUtils.toFile(webRoot);
if (file != null) {
// probably dev env: serving webroot from a directory
// serving the `webapp` folder from a directory
final File classDirectory = file.getAbsoluteFile().getParentFile();
if (!classDirectory.exists()) {
throw new IllegalStateException("Invalid state: " + classDirectory + " doesn't exist");
Expand Down

0 comments on commit 162c745

Please sign in to comment.