Commit 6db3dbda authored by Yann Mombrun's avatar Yann Mombrun
Browse files

WEBLAB-1428 - New version 2.2.2. Enable to start when the content manager...

WEBLAB-1428 - New version 2.2.2. Enable to start when the content manager folder is only accessible with read permissions. Add a warning in that case.
parent 83be0c14
......@@ -9,7 +9,7 @@
</parent>
<artifactId>content-manager</artifactId>
<version>2.2.1</version>
<version>2.2.2</version>
<packaging>jar</packaging>
......
......@@ -266,16 +266,22 @@ public class FileContentManager extends ContentManagerAdapter {
try {
FileUtils.forceMkdir(folder);
} catch (final IOException ioe) {
throw new WebLabUncheckedException("Unable to create Content folder [" + folder + "].", ioe);
final String message = "Unable to create Content folder [" + folder + "].";
this.logger.error(message, ioe);
throw new WebLabUncheckedException(message, ioe);
}
if (!folder.exists()) {
throw new WebLabUncheckedException("Content folder [" + folder + "] does not exists or is not readable.");
}
if (!folder.canWrite()) {
throw new WebLabUncheckedException("Cannot write in content folder [" + folder + "].");
final String message = "Content folder [" + folder + "] does not exists or is not readable.";
this.logger.error(message);
throw new WebLabUncheckedException(message);
}
if (folder.isFile()) {
throw new WebLabUncheckedException("Content folder [" + folder + "] is a File instead of a directory.");
final String message = "Content folder [" + folder + "] is a File instead of a directory.";
this.logger.error(message);
throw new WebLabUncheckedException(message);
}
if (!folder.canWrite()) {
this.logger.warn("Cannot write in content folder [" + folder + "]. If the component only read it should be fine. Otherwise you will have some troubles later...");
}
this.contentFolder = folder;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment