Index: tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java	(revision 1706125)
+++ tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java	(revision )
@@ -16,9 +16,10 @@
  */
 package org.apache.tika.config;
 
-import java.io.File;
 import java.net.URI;
 import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 import java.util.Map;
 
@@ -73,7 +74,7 @@
                 getClass().getClassLoader(), LoadErrorHandler.WARN);
         ServiceLoader throwLoader = new ServiceLoader(
                 getClass().getClassLoader(), LoadErrorHandler.THROW);
-        File configPath = new File(new URI(getConfigPath("TIKA-1700-unknown-parser.xml")));
+        Path configPath = Paths.get(new URI(getConfigPath("TIKA-1700-unknown-parser.xml")));
         
         TikaConfig ignore = new TikaConfig(configPath, ignoreLoader);
         assertNotNull(ignore);
\ No newline at end of file
Index: tika-core/src/main/java/org/apache/tika/config/TikaConfig.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tika-core/src/main/java/org/apache/tika/config/TikaConfig.java	(revision 1706125)
+++ tika-core/src/main/java/org/apache/tika/config/TikaConfig.java	(revision )
@@ -17,12 +17,14 @@
 package org.apache.tika.config;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -88,9 +90,18 @@
 
     public TikaConfig(String file)
             throws TikaException, IOException, SAXException {
-        this(new File(file));
+        this(Paths.get(file));
     }
 
+    public TikaConfig(Path path)
+            throws TikaException, IOException, SAXException {
+        this(path, new ServiceLoader());
+    }
+    public TikaConfig(Path path, ServiceLoader loader)
+            throws TikaException, IOException, SAXException {
+        this(getBuilder().parse(path.toFile()), loader);
+    }
+
     public TikaConfig(File file)
             throws TikaException, IOException, SAXException {
         this(file, new ServiceLoader());
@@ -199,27 +210,7 @@
             this.detector = getDefaultDetector(mimeTypes, serviceLoader);
             this.translator = getDefaultTranslator(serviceLoader);
         } else {
-            // Locate the given configuration file
-            InputStream stream = null;
-            File file = new File(config);
-            if (file.isFile()) {
-                stream = new FileInputStream(file);
-            }
-            if (stream == null) {
-                try {
-                    stream = new URL(config).openStream();
-                } catch (IOException ignore) {
-                }
-            }
-            if (stream == null) {
-                stream = serviceLoader.getResourceAsStream(config);
-            }
-            if (stream == null) {
-                throw new TikaException(
-                        "Specified Tika configuration not found: " + config);
-            }
-
-            try {
+            try (InputStream stream = getConfigInputStream(config, serviceLoader)) {
                 Element element = getBuilder().parse(stream).getDocumentElement();
                 ParserXmlLoader parserLoader = new ParserXmlLoader();
                 DetectorXmlLoader detectorLoader = new DetectorXmlLoader();
@@ -233,12 +224,33 @@
                 throw new TikaException(
                         "Specified Tika configuration has syntax errors: "
                                 + config, e);
-            } finally {
-                stream.close();
             }
         }
     }
 
+    private static InputStream getConfigInputStream(String config, ServiceLoader serviceLoader)
+            throws TikaException, IOException {
+        InputStream stream = null;
+        try {
+            stream = new URL(config).openStream();
+        } catch (IOException ignore) {
+        }
+        if (stream == null) {
+            stream = serviceLoader.getResourceAsStream(config);
+        }
+        if (stream == null) {
+            Path file = Paths.get(config);
+            if (Files.isRegularFile(file)) {
+                stream = Files.newInputStream(file);
+            }
+        }
+        if (stream == null) {
+            throw new TikaException(
+                    "Specified Tika configuration not found: " + config);
+        }
+        return stream;
+    }
+
     private static String getText(Node node) {
         if (node.getNodeType() == Node.TEXT_NODE) {
             return node.getNodeValue();
@@ -398,7 +410,7 @@
                     String mime = getText(cElement);
                     MediaType type = MediaType.parse(mime);
                     if (type != null) {
-                        if (types == null) types = new HashSet<MediaType>();
+                        if (types == null) types = new HashSet<>();
                         types.add(type);
                     } else {
                         throw new TikaException(
@@ -413,8 +425,8 @@
     
     private static ServiceLoader serviceLoaderFromDomElement(Element element, ClassLoader loader) {
         Element serviceLoaderElement = getChild(element, "service-loader");
-        ServiceLoader serviceLoader = null;
+        ServiceLoader serviceLoader;
-        if(serviceLoaderElement != null) {
+        if (serviceLoaderElement != null) {
             boolean dynamic = Boolean.parseBoolean(serviceLoaderElement.getAttribute("dynamic"));
             LoadErrorHandler loadErrorHandler = LoadErrorHandler.IGNORE;
             String loadErrorHandleConfig = serviceLoaderElement.getAttribute("loadErrorHandler");
@@ -709,7 +721,7 @@
                 throws InvocationTargetException, IllegalAccessException,
                 InstantiationException {
             Detector detector = null;
-            Constructor<? extends Detector> c = null;
+            Constructor<? extends Detector> c;
             MediaTypeRegistry registry = mimeTypes.getMediaTypeRegistry();
             
             // Try the possible default and composite detector constructors
