// Path: src/main/java/com/github/vbauer/jconditions/core/CheckerContext.java
// public class CheckerContext<T> {
// 
//     private final Object instance;
//     private final T annotation;
// 
// 
//     public CheckerContext(final Object instance, final T annotation) {
//         this.instance = instance;
//         this.annotation = annotation;
//     }
// 
// 
//     public Object getInstance() {
//         return instance;
//     }
// 
//     public T getAnnotation() {
//         return annotation;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/core/ConditionChecker.java
// public interface ConditionChecker<T> {
// 
//     /**
//      * Checks if execution of test method should be continued or not.
//      *
//      * @param context input data for checker
//      * @return true if execution should be continued and false - otherwise
//      * @throws Exception on any error (it is the same as false in return value)
//      */
//     boolean isSatisfied(CheckerContext<T> context) throws Exception;
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/NetUtils.java
// public final class NetUtils {
// 
//     private static final String HTTP_PREFIX = "http://";
// 
// 
//     private NetUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String fixScheme(final String address) {
//         if (address != null) {
//             final URI uri = URI.create(address);
//             final String scheme = uri.getScheme();
// 
//             if (scheme == null) {
//                 return HTTP_PREFIX + address;
//             }
//         }
//         return address;
//     }
// 
//     public static File copyURLContentToFile(final URLConnection connection, final String target) throws Exception {
//         InputStream input = null;
//         OutputStream output = null;
// 
//         try {
//             final File file = new File(target);
//             output = new FileOutputStream(file);
//             input = connection.getInputStream();
//             InOutUtils.copy(input, output);
//             return file;
//         } finally {
//             InOutUtils.closeQuietly(input);
//             InOutUtils.closeQuietly(output);
//         }
//     }
// 
//     public static URLConnection connectURL(final String uri, final int timeout) throws IOException {
//         final URL url = new URL(uri);
//         final URLConnection connection = url.openConnection();
//         connection.setConnectTimeout(timeout);
//         connection.connect();
//         return connection;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/PropUtils.java
// public final class PropUtils {
// 
//     private static final String VAR_PREFIX = "${";
//     private static final String VAR_POSTFIX = "}";
// 
// 
//     private PropUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String getSystemProperty(final String key) {
//         final Map<String, String> properties = getSystemProperties();
//         return properties.get(key);
//     }
// 
//     public static Map<String, String> getSystemProperties() {
//         final Map<String, String> result = new HashMap<>();
//         result.putAll(System.getenv());
//         result.putAll(convertPropertiesToMap(System.getProperties()));
//         return result;
//     }
// 
//     public static Map<String, String> convertPropertiesToMap(final Properties properties) {
//         final Map<String, String> result = new HashMap<>();
//         for (final String name : properties.stringPropertyNames()) {
//             result.put(name, properties.getProperty(name));
//         }
//         return result;
//     }
// 
//     public static String injectProperties(final String text) {
//         if (text != null && text.contains(VAR_PREFIX)) {
//             String result = text;
//             final Map<String, String> systemProperties = getSystemProperties();
//             for (final Map.Entry<String, String> entry : systemProperties.entrySet()) {
//                 final String key = entry.getKey();
//                 final String value = entry.getValue();
//                 result = result.replace(VAR_PREFIX + key + VAR_POSTFIX, value);
//             }
//             return result;
//         }
//         return text;
//     }
// 
//     public static boolean hasAnyWithProperties(final String value, final String... variants) {
//         for (final String operationSystem : variants) {
//             final String injected = injectProperties(operationSystem);
//             if (TextUtils.containsIgnoreCase(value, injected)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }


import com.github.vbauer.jconditions.annotation.UrlIsReachable;
import com.github.vbauer.jconditions.core.CheckerContext;
import com.github.vbauer.jconditions.core.ConditionChecker;
import com.github.vbauer.jconditions.util.NetUtils;
import com.github.vbauer.jconditions.util.PropUtils;
package com.github.vbauer.jconditions.checker;


/**
 * @author Vladislav Bauer
 */

public class UrlIsReachableChecker implements ConditionChecker<UrlIsReachable> {

    /**
     * {@inheritDoc}
     */
    @Override
// Path: src/main/java/com/github/vbauer/jconditions/core/CheckerContext.java
// public class CheckerContext<T> {
// 
//     private final Object instance;
//     private final T annotation;
// 
// 
//     public CheckerContext(final Object instance, final T annotation) {
//         this.instance = instance;
//         this.annotation = annotation;
//     }
// 
// 
//     public Object getInstance() {
//         return instance;
//     }
// 
//     public T getAnnotation() {
//         return annotation;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/core/ConditionChecker.java
// public interface ConditionChecker<T> {
// 
//     /**
//      * Checks if execution of test method should be continued or not.
//      *
//      * @param context input data for checker
//      * @return true if execution should be continued and false - otherwise
//      * @throws Exception on any error (it is the same as false in return value)
//      */
//     boolean isSatisfied(CheckerContext<T> context) throws Exception;
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/NetUtils.java
// public final class NetUtils {
// 
//     private static final String HTTP_PREFIX = "http://";
// 
// 
//     private NetUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String fixScheme(final String address) {
//         if (address != null) {
//             final URI uri = URI.create(address);
//             final String scheme = uri.getScheme();
// 
//             if (scheme == null) {
//                 return HTTP_PREFIX + address;
//             }
//         }
//         return address;
//     }
// 
//     public static File copyURLContentToFile(final URLConnection connection, final String target) throws Exception {
//         InputStream input = null;
//         OutputStream output = null;
// 
//         try {
//             final File file = new File(target);
//             output = new FileOutputStream(file);
//             input = connection.getInputStream();
//             InOutUtils.copy(input, output);
//             return file;
//         } finally {
//             InOutUtils.closeQuietly(input);
//             InOutUtils.closeQuietly(output);
//         }
//     }
// 
//     public static URLConnection connectURL(final String uri, final int timeout) throws IOException {
//         final URL url = new URL(uri);
//         final URLConnection connection = url.openConnection();
//         connection.setConnectTimeout(timeout);
//         connection.connect();
//         return connection;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/PropUtils.java
// public final class PropUtils {
// 
//     private static final String VAR_PREFIX = "${";
//     private static final String VAR_POSTFIX = "}";
// 
// 
//     private PropUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String getSystemProperty(final String key) {
//         final Map<String, String> properties = getSystemProperties();
//         return properties.get(key);
//     }
// 
//     public static Map<String, String> getSystemProperties() {
//         final Map<String, String> result = new HashMap<>();
//         result.putAll(System.getenv());
//         result.putAll(convertPropertiesToMap(System.getProperties()));
//         return result;
//     }
// 
//     public static Map<String, String> convertPropertiesToMap(final Properties properties) {
//         final Map<String, String> result = new HashMap<>();
//         for (final String name : properties.stringPropertyNames()) {
//             result.put(name, properties.getProperty(name));
//         }
//         return result;
//     }
// 
//     public static String injectProperties(final String text) {
//         if (text != null && text.contains(VAR_PREFIX)) {
//             String result = text;
//             final Map<String, String> systemProperties = getSystemProperties();
//             for (final Map.Entry<String, String> entry : systemProperties.entrySet()) {
//                 final String key = entry.getKey();
//                 final String value = entry.getValue();
//                 result = result.replace(VAR_PREFIX + key + VAR_POSTFIX, value);
//             }
//             return result;
//         }
//         return text;
//     }
// 
//     public static boolean hasAnyWithProperties(final String value, final String... variants) {
//         for (final String operationSystem : variants) {
//             final String injected = injectProperties(operationSystem);
//             if (TextUtils.containsIgnoreCase(value, injected)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }


// Path: src/main/java/com/github/vbauer/jconditions/checker/UrlIsReachableChecker.java
import com.github.vbauer.jconditions.annotation.UrlIsReachable;
import com.github.vbauer.jconditions.core.CheckerContext;
import com.github.vbauer.jconditions.core.ConditionChecker;
import com.github.vbauer.jconditions.util.NetUtils;
import com.github.vbauer.jconditions.util.PropUtils;

package com.github.vbauer.jconditions.checker;


/**
 * @author Vladislav Bauer
 */

public class UrlIsReachableChecker implements ConditionChecker<UrlIsReachable> {

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSatisfied(final CheckerContext<UrlIsReachable> context) {