package org.helioviewer.jhv.io;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;

import okio.BufferedSource;
import okio.Okio;

class NetClientLocal implements NetClient {

    private final BufferedSource response;

    NetClientLocal(URI uri) throws IOException {
        try {
            response = Okio.buffer(Okio.source(Paths.get(uri.getPath())));
        } catch (Exception e) {
            throw new IOException(e);
        }
    }

    @Override
    public boolean isSuccessful() {
        return true;
    }

    @Override
    public InputStream getStream() {
        return response.inputStream();
    }

    @Override
    public Reader getReader() {
        return new InputStreamReader(response.inputStream(), StandardCharsets.UTF_8);
    }

    @Override
    public BufferedSource getSource() {
        return response;
    }

    @Override
    public long getContentLength() {
        return -1;
    }

    @Override
    public void close() throws IOException {
        response.close();
    }

}

@@ -26,16 +26,37 @@
 hv.io;%0A%0A
+import java.io.File;%0A
 import j
@@ -226,36 +226,8 @@
 ets;
-%0Aimport java.nio.file.Paths;
 %0A%0Aim
@@ -474,17 +474,16 @@
 rce(
-Paths.get
+new File
 (uri

Fix Windows