package com.twingly.search;

import java.io.FileInputStream;
import java.net.URL;
import java.util.Properties;

/**
 * API-wide constants
 */
public final class Constants {

    /**
     * The constant DATE_FORMAT.
     */
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /**
     * The constant TWINGLY_API_KEY_PROPERTY
     */
    public static final String TWINGLY_API_KEY_PROPERTY = "TWINGLY_SEARCH_KEY";
    private static final Properties VERSION_PROPERTIES = new Properties();
    /**
     * The constant VERSION.
     */
    public static final String VERSION = VERSION_PROPERTIES.getProperty("version");

    static {
        URL resource = Constants.class.getClassLoader().getResource("version.properties");
        assert resource != null;
        try (FileInputStream fis = new FileInputStream(resource.getFile())) {
            VERSION_PROPERTIES.load(fis);
        } catch (Exception e) {
            throw new RuntimeException("version.properties was not found or cannot be read", e);
        }
    }
}

@@ -37,20 +37,24 @@
 java.io.
-File
+Buffered
 InputStr
@@ -784,20 +784,24 @@
    try (
-File
+Buffered
 InputStr
@@ -804,17 +804,17 @@
 tStream 
-f
+b
 is = new
@@ -814,20 +814,24 @@
 s = new 
-File
+Buffered
 InputStr
@@ -847,15 +847,18 @@
 rce.
-getFile
+openStream
 ()))
@@ -896,17 +896,17 @@
 ES.load(
-f
+b
 is);%0A   

update version receiving for Java API