--- /dev/null 2015-04-26 06:51:08.003313989 -0700
+++ new/jdk/src/jdk.jline/share/classes/jdk/internal/jline/internal/Configuration.java 2015-06-18 03:04:49.497698868 -0700
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2002-2012, the original author or authors.
+ *
+ * This software is distributable under the BSD license. See the terms of the
+ * BSD license in the documentation provided with this software.
+ *
+ * http://www.opensource.org/licenses/bsd-license.php
+ */
+package jdk.internal.jline.internal;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.Map;
+import java.util.Properties;
+
+import static jdk.internal.jline.internal.Preconditions.checkNotNull;
+
+/**
+ * Provides access to configuration values.
+ *
+ * @author Jason Dillon
+ * @author Guillaume Nodet
+ * @since 2.4
+ */
+public class Configuration
+{
+ /**
+ * System property which can point to a file or URL containing configuration properties to load.
+ *
+ * @since 2.7
+ */
+ public static final String JLINE_CONFIGURATION = "jline.configuration";
+
+ /**
+ * Default configuration file name loaded from user's home directory.
+ */
+ public static final String JLINE_RC = ".jline.rc";
+
+ private static volatile Properties properties;
+
+ private static Properties initProperties() {
+ URL url = determineUrl();
+ Properties props = new Properties();
+ try {
+ loadProperties(url, props);
+ }
+ catch (IOException e) {
+ // debug here instead of warn, as this can happen normally if default jline.rc file is missing
+ Log.debug("Unable to read configuration from: ", url, e);
+ }
+ return props;
+ }
+
+ private static void loadProperties(final URL url, final Properties props) throws IOException {
+ Log.debug("Loading properties from: ", url);
+ InputStream input = url.openStream();
+ try {
+ props.load(new BufferedInputStream(input));
+ }
+ finally {
+ try {
+ input.close();
+ }
+ catch (IOException e) {
+ // ignore
+ }
+ }
+
+ if (Log.DEBUG) {
+ Log.debug("Loaded properties:");
+ for (Map.Entry