// Path: src/main/java/ninja/eivind/hotsreplayuploader/models/stringconverters/StatusBinder.java
// @Component
// public class StatusBinder {
// 
//     private final StringProperty message = new SimpleStringProperty();
// 
//     public StringProperty message() {
//         return message;
//     }
// }
// 
// Path: src/main/java/ninja/eivind/hotsreplayuploader/utils/SimpleHttpClient.java
// public class SimpleHttpClient {
// 
//     public static final String SPACE = "%20";
//     private static final Logger LOG = LoggerFactory.getLogger(SimpleHttpClient.class);
// 
//     /**
//      * Encodes a given String url into a valid URI if possible
//      * Method should be updated as required to make sure any valid String url that can be pasted into an address bar
//      * will fit into a URI object
//      *
//      * @param url the url to encode
//      * @return a newly built URI if at all possible
//      */
//     public static URI encode(final String url) {
//         return URI.create(url.replaceAll(" ", SPACE));
//     }
// 
//     public String simpleRequest(final String target) throws IOException {
//         return simpleRequest(encode(target));
//     }
// 
//     public String simpleRequest(final URI uri) throws IOException {
//         return simpleRequest(uri.toURL());
//     }
// 
//     public String simpleRequest(final URL url) throws IOException {
//         LOG.info("Opening connection to " + url);
//         final InputStream inputStream = url.openStream();
//         return IOUtils.readInputStream(inputStream);
//     }
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javafx.fxml.FXMLLoader;
import javafx.util.BuilderFactory;
import ninja.eivind.hotsreplayuploader.models.stringconverters.StatusBinder;
import ninja.eivind.hotsreplayuploader.utils.SimpleHttpClient;
import ninja.eivind.stormparser.StandaloneBattleLobbyParser;
import ninja.eivind.stormparser.StormParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
// Copyright 2016 Eivind Vegsundvåg
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


package ninja.eivind.hotsreplayuploader.di;


@Configuration
@ComponentScan()
public class HotSReplayUploaderConfiguration {

    private static final Logger LOG = LoggerFactory.getLogger(HotSReplayUploaderConfiguration.class);

    @Bean
    public ObjectMapper objectMapper() {
        LOG.info("Building ObjectMapper");
        return new ObjectMapper().registerModule(new JavaTimeModule());
    }

    @Bean
// Path: src/main/java/ninja/eivind/hotsreplayuploader/models/stringconverters/StatusBinder.java
// @Component
// public class StatusBinder {
// 
//     private final StringProperty message = new SimpleStringProperty();
// 
//     public StringProperty message() {
//         return message;
//     }
// }
// 
// Path: src/main/java/ninja/eivind/hotsreplayuploader/utils/SimpleHttpClient.java
// public class SimpleHttpClient {
// 
//     public static final String SPACE = "%20";
//     private static final Logger LOG = LoggerFactory.getLogger(SimpleHttpClient.class);
// 
//     /**
//      * Encodes a given String url into a valid URI if possible
//      * Method should be updated as required to make sure any valid String url that can be pasted into an address bar
//      * will fit into a URI object
//      *
//      * @param url the url to encode
//      * @return a newly built URI if at all possible
//      */
//     public static URI encode(final String url) {
//         return URI.create(url.replaceAll(" ", SPACE));
//     }
// 
//     public String simpleRequest(final String target) throws IOException {
//         return simpleRequest(encode(target));
//     }
// 
//     public String simpleRequest(final URI uri) throws IOException {
//         return simpleRequest(uri.toURL());
//     }
// 
//     public String simpleRequest(final URL url) throws IOException {
//         LOG.info("Opening connection to " + url);
//         final InputStream inputStream = url.openStream();
//         return IOUtils.readInputStream(inputStream);
//     }
// }


// Path: src/main/java/ninja/eivind/hotsreplayuploader/di/HotSReplayUploaderConfiguration.java
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javafx.fxml.FXMLLoader;
import javafx.util.BuilderFactory;
import ninja.eivind.hotsreplayuploader.models.stringconverters.StatusBinder;
import ninja.eivind.hotsreplayuploader.utils.SimpleHttpClient;
import ninja.eivind.stormparser.StandaloneBattleLobbyParser;
import ninja.eivind.stormparser.StormParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

// Copyright 2016 Eivind Vegsundvåg
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


package ninja.eivind.hotsreplayuploader.di;


@Configuration
@ComponentScan()
public class HotSReplayUploaderConfiguration {

    private static final Logger LOG = LoggerFactory.getLogger(HotSReplayUploaderConfiguration.class);

    @Bean
    public ObjectMapper objectMapper() {
        LOG.info("Building ObjectMapper");
        return new ObjectMapper().registerModule(new JavaTimeModule());
    }

    @Bean
    public SimpleHttpClient httpClient() {