package io.wovn.wovnjava;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.HttpURLConnection;
import java.nio.charset.Charset;

import javax.servlet.FilterConfig;

class Store {
    Settings settings;

    Store(FilterConfig config) {
        super();
        settings = new Settings(config);
    }

    Values getValues(String url) {
        url = url.replaceAll("/$", "");

        String json = "";
        try {
            URL uri = new URL(settings.apiUrl + "?token=" + settings.userToken + "&url=" + url);
            HttpURLConnection connection = null;

            try {
                connection = (HttpURLConnection) uri.openConnection();
                connection.setRequestMethod("GET");

                if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
                    InputStreamReader isr = new InputStreamReader(connection.getInputStream(), Charset.forName("UTF-8"));
                    BufferedReader reader = new BufferedReader(isr);
                    try {
                        String line;
                        while ((line = reader.readLine()) != null) {
                            json += line;
                        }
                    } finally {
                        reader.close();
                        isr.close();
                    }
                }
            } finally {
                if (connection != null) {
                    connection.disconnect();
                }
            }
        } catch (IOException e) {
        }

        if (json.length() == 0) {
            json = "{}";
        }

        return new Values(json);
    }
}

@@ -1276,32 +1276,66 @@
     %7D finally %7B%0A
+                        try %7B%0A    
                 
@@ -1386,20 +1386,206 @@
     
-isr.close();
+%7D catch (IOException e) %7B%0A                        %7D%0A                        try %7B%0A                            isr.close();%0A                        %7D catch (IOException e) %7B%0A                        %7D
 %0A   

Update Store.java.