Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B089A17D99 for ; Sun, 26 Apr 2015 07:37:38 +0000 (UTC) Received: (qmail 35360 invoked by uid 500); 26 Apr 2015 07:37:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 35253 invoked by uid 500); 26 Apr 2015 07:37:38 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 35242 invoked by uid 99); 26 Apr 2015 07:37:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2015 07:37:38 +0000 Date: Sun, 26 Apr 2015 07:37:38 +0000 (UTC) From: "Michael Osipov (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IO-477) Exception on Mac only: Unexpected end of file from server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14512927#comment-14512927 ] Michael Osipov commented on IO-477: ----------------------------------- Have you tried with {{curl}} too? This might be problem either with the server or on OS side. > Exception on Mac only: Unexpected end of file from server > --------------------------------------------------------- > > Key: IO-477 > URL: https://issues.apache.org/jira/browse/IO-477 > Project: Commons IO > Issue Type: Bug > Components: Utilities > Environment: mac os x Yosemite version 10.10.2 (14C1514) > Reporter: amr lotfy > Labels: osx > > http://stackoverflow.com/q/29853775/1356559 > http://qr.ae/L6aYM > I am downloading mp3 and image files using "org.apache.commons.io.FileUtils" in the following code successfully on windows 7: > FileUtils.copyURLToFile(new URL(urlString),myFile); > but on mac os x Yosemite version 10.10.2 (14C1514) I get this exception after few downloads: > java.net.SocketException: Unexpected end of file from server > at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:792) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647) > at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:789) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647) > at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1535) > at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440) > I have tried adding a timeout > FileUtils.copyURLToFile(new URL(url),myFile ,60000,60000); > or even using other methods > URLConnection conn = new URL(url).openConnection(); > InputStream is = conn.getInputStream(); > OutputStream outstream = new FileOutputStream(myFile); > byte[] buffer = new byte[4096]; > int len; > while ((len = is.read(buffer)) > 0) { > outstream.write(buffer, 0, len); > } > outstream.close(); > Update: > I tried to disable WiFi (to avoid any connectivity bugs) and used wired ethernet but still have the same error after few downloads, any help is appreciated. -- This message was sent by Atlassian JIRA (v6.3.4#6332)