From a21188a064b8870ab44b7f991df77a271c2596c1 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 17 Apr 2019 23:08:26 +0200 Subject: [PATCH] Add a permission check for the podcast folder This should make podcast-related stacktraces a bit more obvious to debug for users. --- .../main/java/org/airsonic/player/service/PodcastService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java b/airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java index ce0e43f4..9fbcbe6f 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java +++ b/airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java @@ -693,6 +693,10 @@ public class PodcastService { File podcastDir = new File(settingsService.getPodcastFolder()); File channelDir = new File(podcastDir, StringUtil.fileSystemSafe(channel.getTitle())); + if (!podcastDir.canWrite()) { + throw new RuntimeException("The podcasts directory " + podcastDir + " isn't writeable."); + } + if (!channelDir.exists()) { boolean ok = channelDir.mkdirs(); if (!ok) {