http-client-branch: removed unused ResponseSubscribers.MultiFile http-client-branch
authorprappo
Wed, 08 Nov 2017 18:22:38 +0300
branchhttp-client-branch
changeset 55785 eb4826e9f3f6
parent 55783 5cd3c3a62aaf
child 55786 a32b59f7b7fb
http-client-branch: removed unused ResponseSubscribers.MultiFile
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java	Wed Nov 08 14:20:49 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java	Wed Nov 08 18:22:38 2017 +0300
@@ -474,39 +474,6 @@
         }
     }
 
-    static class MultiFile {
-
-        final Path pathRoot;
-
-        MultiFile(Path destination) {
-            if (!destination.toFile().isDirectory())
-                throw new UncheckedIOException(new IOException("destination is not a directory"));
-            pathRoot = destination;
-        }
-
-        Optional<HttpResponse.BodyHandler<Path>> handlePush(HttpRequest request) {
-            final URI uri = request.uri();
-            String path = uri.getPath();
-            while (path.startsWith("/"))
-                path = path.substring(1);
-            Path p = pathRoot.resolve(path);
-            if (Log.trace()) {
-                Log.logTrace("Creating file body subscriber for URI={0}, path={1}",
-                             uri, p);
-            }
-            try {
-                Files.createDirectories(p.getParent());
-            } catch (IOException ex) {
-                throw new UncheckedIOException(ex);
-            }
-
-            final HttpResponse.BodyHandler<Path> proc =
-                 HttpResponse.BodyHandler.asFile(p);
-
-            return Optional.of(proc);
-        }
-    }
-
     /**
      * Currently this consumes all of the data and ignores it
      */