stefanseifert commented on a change in pull request #4:
URL: 
https://github.com/apache/sling-org-apache-sling-installer-provider-file/pull/4#discussion_r754298684



##########
File path: 
src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java
##########
@@ -84,6 +88,13 @@ public void start(final OsgiInstaller installer, final 
SlingSettingsService sett
                 key = "${sling.home}" + 
key.substring(settings.getSlingHomePath().length());
             }
             logger.debug("Starting monitor for {}", config.directory);
+            if (autoCreateDirectories) {
+                try {
+                    Files.createDirectory(Paths.get(config.directory));

Review comment:
       shouldn't we use here createDirectories instead of createDirectory? not 
tested it, but just looking at the 
[documentation](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#createDirectories-java.nio.file.Path-java.nio.file.attribute.FileAttribute...-)
 it seems that the latter may create an exception if the directory already 
exists, whereas the former should not. furthermore it might be helpful to also 
create missing parent directories.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to