Java не скачивает файл

Есть файл на внутреннем сервере При скачивании скачивается всего 4кб. Не пойму в чем проблема?

   String tempDir = System.getProperty("java.io.tmpdir");
        String outputPath = tempDir + "/" + filename;

        InputStream inputStream = new URL(path).openStream();
        FileOutputStream fileOS = new FileOutputStream(outputPath);

таким способом тоже самое

 String tempDir = System.getProperty("java.io.tmpdir");
        String outputPath = tempDir + "/" + filename;

        InputStream inputStream = new URL(path).openStream();
        FileOutputStream fileOS = new FileOutputStream(outputPath);
        URL url = new URL(path);
        BufferedInputStream bis = new BufferedInputStream(url.openStream());
        FileOutputStream fis = new FileOutputStream(outputPath);
        byte[] buffer = new byte[1024];
        int count=0;
        while((count = bis.read(buffer,0,1024)) != -1)
        {
            fis.write(buffer, 0, count);
        }
        fis.close();
        bis.close();
        

Ответы (0 шт):