@@ -0,0 +1,2624 @@
+package com.github.sbugat.doxia.module.github_markdown;%0A%0Aimport java.io.IOException;%0Aimport java.io.Reader;%0Aimport java.nio.charset.StandardCharsets;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.Properties;%0A%0Apublic class GitHubMarkdownParserConfiguration %7B%0A%0A%09private static final String GITHUB_USER = %22github.user%22;%0A%09private static final String GITHUB_REPOSITORY = %22github.repository%22;%0A%09private static final String AUTHENTICATION_TOKEN = %22authentication.token%22;%0A%09private static final String FILE_ENCODING_PROPERTY = %22file.encoding%22;%0A%09private static final String FILE_ENCODING_PROPERTY_DEFAULT_VALUE = StandardCharsets.UTF_8.name();%0A%0A%09private static final String GITHUB_MARKDOWN_PARSER_PROPERTIES_FILE = %22doxia-github-markdown.properties%22;%0A%0A%09private String gitHubUser;%0A%0A%09private String gitHubRepository;%0A%0A%09private String authenticationToken;%0A%0A%09private String fileEncoding = FILE_ENCODING_PROPERTY_DEFAULT_VALUE;%0A%0A%09public GitHubMarkdownParserConfiguration() %7B%0A%0A%09%09//Configuration loading%0A%09%09final Path propertyFile = Paths.get( GITHUB_MARKDOWN_PARSER_PROPERTIES_FILE );%0A%09%09if( ! Files.exists( propertyFile ) )%7B%0A%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09//Load the configuration file and extract properties%0A%09%09final Properties properties = new Properties();%0A%09%09Reader propertyFileReader = null;%0A%09%09try %7B%0A%09%09%09propertyFileReader = Files.newBufferedReader( propertyFile, StandardCharsets.UTF_8 );%0A%09%09%09properties.load( propertyFileReader );%0A%09%09%7D%0A%09%09catch( final IOException e )%7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09finally %7B%0A%09%09%09if( null != propertyFileReader )%7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09propertyFileReader.close();%0A%09%09%09%09%7D%0A%09%09%09%09catch( final IOException e ) %7B%0A%09%09%09%09%09//Give up%0A%09%09%09%09%09return;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09gitHubUser = properties.getProperty( GITHUB_USER );%0A%09%09gitHubRepository = properties.getProperty( GITHUB_REPOSITORY );%0A%0A%09%09authenticationToken = properties.getProperty( AUTHENTICATION_TOKEN );%0A%09%09fileEncoding = getOptionnalProperty( properties, FILE_ENCODING_PROPERTY, FILE_ENCODING_PROPERTY_DEFAULT_VALUE );%0A%09%7D%0A%0A%09private static String getOptionnalProperty( final Properties properties, final String propertyName, final String propertyDefaultValue ) %7B%0A%0A%09%09final String propertyValue = properties.getProperty( propertyName, propertyDefaultValue );%0A%0A%09%09if( null == propertyValue %7C%7C propertyValue.isEmpty() ) %7B%0A%09%09%09return propertyDefaultValue;%0A%09%09%7D%0A%0A%09%09return propertyValue;%0A%09%7D%0A%0A%09public String getGitHubUser() %7B%0A%09%09return gitHubUser;%0A%09%7D%0A%0A%09public String getGitHubRepository() %7B%0A%09%09return gitHubRepository;%0A%09%7D%0A%0A%09public String getAuthenticationToken() %7B%0A%09%09return authenticationToken;%0A%09%7D%0A%0A%09public String getFileEncoding() %7B%0A%09%09return fileEncoding;%0A%09%7D%0A%0A%7D%0A

Add configuration loading class