public static void main(String[] args) throws IOException {

        String configuration = System.getProperty("org.lecharpentier.media.config.file");
        Properties applicationConfiguration = new Properties();
        if (configuration != null && Files.exists(Paths.get(configuration))) {
            applicationConfiguration.load(new FileInputStream(configuration));
        }

        int maxRecursion = Integer.parseInt(applicationConfiguration.getProperty(PROPERTY_PREFIX + ".depth"));

        for (Enumeration en = applicationConfiguration.keys(); en.hasMoreElements(); ) {
            String key = (String) en.nextElement();
            if (key.startsWith(PROPERTY_PREFIX + ".")) {
                try {
                    String directory = applicationConfiguration.getProperty(key);
                    if (Files.exists(Paths.get(directory)) && Files.isDirectory(Paths.get(directory))) {
                        setWatchingOnPath(Paths.get(directory), maxRecursion - 1);
                    } else {
                        LOGGER.warn("Cannot watch {} as doesn't exist or not a directory", directory);
                    }
                } catch (IOException e) {
                    LOGGER.warn("An error occured : " + e.getMessage(), e);
                }
            }
        }
    }