// Path: src/main/java/com/tomtom/services/configuration/ConfigurationServiceProperties.java
// @SuppressWarnings("squid:S2637")
// public class ConfigurationServiceProperties implements HasProperties {
// 
//     @Nonnull
//     private final String startupConfigurationURI;
// 
//     @Inject
//     public ConfigurationServiceProperties(
//             @Named("ConfigurationService.startupConfigurationURI") @Nonnull final String startupConfigurationURI) {
//         this.startupConfigurationURI = startupConfigurationURI.trim();
//     }
// 
//     @Nonnull
//     public String getStartupConfigurationURI() {
//         return startupConfigurationURI;
//     }
// }
// 
// Path: src/main/java/com/tomtom/services/configuration/HelperResource.java
// @Path("/")
// public interface HelperResource {
// 
//     /**
//      * This method provides help info.
//      *
//      * @return Returns help text as HTML.
//      */
//     @GET
//     @Produces(MediaType.TEXT_HTML)
//     @Nonnull
//     String getHelpHTML();
// 
//     /**
//      * Additional method: this method returns the current version of the application.
//      * <p>
//      * Return HTTP status 200.
//      *
//      * @param response Version, {@link com.tomtom.services.configuration.dto.VersionDTO}.
//      */
//     @GET
//     @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
//     @Path("version")
//     void getVersion(@Suspended @Nonnull AsyncResponse response);
// 
//     /**
//      * This method returns whether the service is operational or not (status code 200 is OK).
//      *
//      * @param response Returns a version number as JSON.
//      */
//     @GET
//     @Path("status")
//     @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
//     void getStatus(@Suspended @Nonnull AsyncResponse response);
// }
// 
// Path: src/main/java/com/tomtom/services/configuration/dto/VersionDTO.java
// @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass", "squid:S2160"})
// @JsonInclude(Include.NON_EMPTY)
// @XmlRootElement(name = "version")
// @XmlAccessorType(XmlAccessType.FIELD)
// public final class VersionDTO extends ApiDTO {
//     public static final int API_VERSION_MAX_LENGTH = 25;
//     public static final int API_VERSION_MIN_LENGTH = 0;
// 
//     /**
//      * Version string of service. No assumptions can be made on its format.
//      */
//     @JsonProperty("version")
//     @XmlElement(name = "version")
//     @Nullable
//     private String version;
// 
//     /**
//      * The URI of the startup configuration, which was read during startup of the service.
//      * If not start configuration was specified, this element is empty.
//      */
//     @XmlElement(name = "startupConfigurationURI")
//     @Nullable
//     private String startupConfigurationURI;
// 
//     public VersionDTO(
//             @Nonnull final String version,
//             @Nullable final String startupConfigurationURI) {
//         super();
//         setVersion(version);
//         setStartupConfigurationURI(startupConfigurationURI);
//     }
// 
//     @SuppressWarnings({"UnusedDeclaration", "squid:MissingDeprecatedCheck", "squid:S1133"})
//     @Deprecated
//     VersionDTO() {
//         // Default constructor required by JAX-B.
//         super();
//     }
// 
//     /**
//      * For an explanation of validate(), see {@link NodeDTO}.
//      */
//     @Override
//     public void validate() {
//         validator().start();
//         validator().checkString(true, "version", version,
//                 API_VERSION_MIN_LENGTH, API_VERSION_MAX_LENGTH);
//         validator().checkString(false, "startupConfigurationURI", startupConfigurationURI,
//                 0, Integer.MAX_VALUE);
//         validator().done();
//     }
// 
//     @Nonnull
//     public String getVersion() {
//         beforeGet();
//         //noinspection ConstantConditions
//         return version;                             // Cannot be null after validation.
//     }
// 
//     public void setVersion(@Nonnull final String version) {
//         beforeSet();
//         this.version = StringUtils.trim(version);
//     }
// 
//     @Nullable
//     public String getStartupConfigurationURI() {
//         beforeGet();
//         return startupConfigurationURI;
//     }
// 
//     public void setStartupConfigurationURI(@Nullable final String startupConfigurationURI) {
//         beforeSet();
//         this.startupConfigurationURI = StringUtils.emptyToNull(StringUtils.trim(startupConfigurationURI));
//     }
// }


import com.google.common.base.Joiner;
import com.tomtom.services.configuration.ConfigurationServiceProperties;
import com.tomtom.services.configuration.HelperResource;
import com.tomtom.services.configuration.dto.VersionDTO;
import com.tomtom.speedtools.maven.MavenProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
            "It just returns a node if it exists or `404 NOT FOUND` if it doesn't.\n" +
            "The returned response looks like this:\n\n" +

            "  {\"nodes\": [\"{node1}\", \"{node2}\", ...],\n" +
            "  \"parameters\": [{\"key\": \"{key1}\", \"value\": \"{value1}\"]}, ...]," +
            "  \"match\": \"{node-name\"}}\n\n" +

            "The \"nodes\" array is optional and lists the children nodes with search\n" +
            "terms one level below the specified node.\n\n" +

            "The \"parameters\" value is the optional leaf node of this node and lists the\n" +
            "search result (an array of key-value pairs).\n\n" +

            "Note that this is exactly the same format as the configuration file for the service.\n" +

            "Return codes:\n" +
            "  Successful call:                                          200 - OK\n" +
            "  Not modified since If-Modified-Since or ETag not changed: 304 - NOT MODIFIED\n" +
            "  Node not found or no search result found:                 404 - NOT FOUND\n";

    /**
     * The search tree, which holds all configurations.
     */
    @Nonnull
    private final Configuration configuration;

    /**
     * Specific ACDS properties from the properties file.
     */
    @Nonnull
// Path: src/main/java/com/tomtom/services/configuration/ConfigurationServiceProperties.java
// @SuppressWarnings("squid:S2637")
// public class ConfigurationServiceProperties implements HasProperties {
// 
//     @Nonnull
//     private final String startupConfigurationURI;
// 
//     @Inject
//     public ConfigurationServiceProperties(
//             @Named("ConfigurationService.startupConfigurationURI") @Nonnull final String startupConfigurationURI) {
//         this.startupConfigurationURI = startupConfigurationURI.trim();
//     }
// 
//     @Nonnull
//     public String getStartupConfigurationURI() {
//         return startupConfigurationURI;
//     }
// }
// 
// Path: src/main/java/com/tomtom/services/configuration/HelperResource.java
// @Path("/")
// public interface HelperResource {
// 
//     /**
//      * This method provides help info.
//      *
//      * @return Returns help text as HTML.
//      */
//     @GET
//     @Produces(MediaType.TEXT_HTML)
//     @Nonnull
//     String getHelpHTML();
// 
//     /**
//      * Additional method: this method returns the current version of the application.
//      * <p>
//      * Return HTTP status 200.
//      *
//      * @param response Version, {@link com.tomtom.services.configuration.dto.VersionDTO}.
//      */
//     @GET
//     @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
//     @Path("version")
//     void getVersion(@Suspended @Nonnull AsyncResponse response);
// 
//     /**
//      * This method returns whether the service is operational or not (status code 200 is OK).
//      *
//      * @param response Returns a version number as JSON.
//      */
//     @GET
//     @Path("status")
//     @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
//     void getStatus(@Suspended @Nonnull AsyncResponse response);
// }
// 
// Path: src/main/java/com/tomtom/services/configuration/dto/VersionDTO.java
// @SuppressWarnings({"EqualsWhichDoesntCheckParameterClass", "squid:S2160"})
// @JsonInclude(Include.NON_EMPTY)
// @XmlRootElement(name = "version")
// @XmlAccessorType(XmlAccessType.FIELD)
// public final class VersionDTO extends ApiDTO {
//     public static final int API_VERSION_MAX_LENGTH = 25;
//     public static final int API_VERSION_MIN_LENGTH = 0;
// 
//     /**
//      * Version string of service. No assumptions can be made on its format.
//      */
//     @JsonProperty("version")
//     @XmlElement(name = "version")
//     @Nullable
//     private String version;
// 
//     /**
//      * The URI of the startup configuration, which was read during startup of the service.
//      * If not start configuration was specified, this element is empty.
//      */
//     @XmlElement(name = "startupConfigurationURI")
//     @Nullable
//     private String startupConfigurationURI;
// 
//     public VersionDTO(
//             @Nonnull final String version,
//             @Nullable final String startupConfigurationURI) {
//         super();
//         setVersion(version);
//         setStartupConfigurationURI(startupConfigurationURI);
//     }
// 
//     @SuppressWarnings({"UnusedDeclaration", "squid:MissingDeprecatedCheck", "squid:S1133"})
//     @Deprecated
//     VersionDTO() {
//         // Default constructor required by JAX-B.
//         super();
//     }
// 
//     /**
//      * For an explanation of validate(), see {@link NodeDTO}.
//      */
//     @Override
//     public void validate() {
//         validator().start();
//         validator().checkString(true, "version", version,
//                 API_VERSION_MIN_LENGTH, API_VERSION_MAX_LENGTH);
//         validator().checkString(false, "startupConfigurationURI", startupConfigurationURI,
//                 0, Integer.MAX_VALUE);
//         validator().done();
//     }
// 
//     @Nonnull
//     public String getVersion() {
//         beforeGet();
//         //noinspection ConstantConditions
//         return version;                             // Cannot be null after validation.
//     }
// 
//     public void setVersion(@Nonnull final String version) {
//         beforeSet();
//         this.version = StringUtils.trim(version);
//     }
// 
//     @Nullable
//     public String getStartupConfigurationURI() {
//         beforeGet();
//         return startupConfigurationURI;
//     }
// 
//     public void setStartupConfigurationURI(@Nullable final String startupConfigurationURI) {
//         beforeSet();
//         this.startupConfigurationURI = StringUtils.emptyToNull(StringUtils.trim(startupConfigurationURI));
//     }
// }


// Path: src/main/java/com/tomtom/services/configuration/implementation/HelperResourceImpl.java
import com.google.common.base.Joiner;
import com.tomtom.services.configuration.ConfigurationServiceProperties;
import com.tomtom.services.configuration.HelperResource;
import com.tomtom.services.configuration.dto.VersionDTO;
import com.tomtom.speedtools.maven.MavenProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

            "It just returns a node if it exists or `404 NOT FOUND` if it doesn't.\n" +
            "The returned response looks like this:\n\n" +

            "  {\"nodes\": [\"{node1}\", \"{node2}\", ...],\n" +
            "  \"parameters\": [{\"key\": \"{key1}\", \"value\": \"{value1}\"]}, ...]," +
            "  \"match\": \"{node-name\"}}\n\n" +

            "The \"nodes\" array is optional and lists the children nodes with search\n" +
            "terms one level below the specified node.\n\n" +

            "The \"parameters\" value is the optional leaf node of this node and lists the\n" +
            "search result (an array of key-value pairs).\n\n" +

            "Note that this is exactly the same format as the configuration file for the service.\n" +

            "Return codes:\n" +
            "  Successful call:                                          200 - OK\n" +
            "  Not modified since If-Modified-Since or ETag not changed: 304 - NOT MODIFIED\n" +
            "  Node not found or no search result found:                 404 - NOT FOUND\n";

    /**
     * The search tree, which holds all configurations.
     */
    @Nonnull
    private final Configuration configuration;

    /**
     * Specific ACDS properties from the properties file.
     */
    @Nonnull
    private final ConfigurationServiceProperties configurationServiceProperties;