Changeset efa72db
- Timestamp:
- May 15, 2019 10:32:54 AM (2 years ago)
- Branches:
- master
- Children:
- 6600f37
- Parents:
- 4e267f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/util/EepGet.java
r4e267f6 refa72db 142 142 } 143 143 144 /** 145 * @param outputFile ignored if outputStream is non-null 146 * @param outputStream takes precedence over outputFile 147 */ 144 148 public EepGet(I2PAppContext ctx, boolean shouldProxy, String proxyHost, int proxyPort, 145 149 int numRetries, long minSize, long maxSize, String outputFile, OutputStream outputStream, … … 148 152 } 149 153 154 /** 155 * @param outputFile ignored if outputStream is non-null 156 * @param outputStream takes precedence over outputFile 157 */ 150 158 public EepGet(I2PAppContext ctx, boolean shouldProxy, String proxyHost, int proxyPort, 151 159 int numRetries, long minSize, long maxSize, … … 593 601 * 594 602 * Header timeout default 45 sec, total timeout default none, inactivity timeout default 60 sec. 603 * 604 * @return success 595 605 */ 596 606 public boolean fetch() { return fetch(_fetchHeaderTimeout); } … … 602 612 * 603 613 * Total timeout default none, inactivity timeout default 60 sec. 614 * 615 * @return success 604 616 */ 605 617 public boolean fetch(long fetchHeaderTimeout) { … … 613 625 * @param totalTimeout <= 0 for default none 614 626 * @param inactivityTimeout <= 0 for default 60 sec 627 * @return success 615 628 */ 616 629 public boolean fetch(long fetchHeaderTimeout, long totalTimeout, long inactivityTimeout) { … … 938 951 case 208: 939 952 case 226: 940 if (_outputStream != null) 953 if (_outputStream != null) { 954 if (_alreadyTransferred > 0) { 955 // asked for partial but didn't get it, 956 // can't rewind the stream 957 rcOk = true; 958 _keepFetching = false; 959 _transferFailed = true; 960 break; 961 } 941 962 _out = _outputStream; 942 else 963 } else { 943 964 _out = new FileOutputStream(_outputFile, false); 965 } 944 966 _alreadyTransferred = 0; 945 967 rcOk = true; … … 1322 1344 url = new URI(_actualURL); 1323 1345 } catch (URISyntaxException use) { 1324 IOException ioe = new MalformedURLException("Bad URL ");1346 IOException ioe = new MalformedURLException("Bad URL: " + _actualURL); 1325 1347 ioe.initCause(use); 1326 1348 throw ioe; … … 1328 1350 String host = url.getHost(); 1329 1351 if (host == null || host.length() <= 0) 1330 throw new MalformedURLException("Bad URL, no host ");1352 throw new MalformedURLException("Bad URL, no host: " + url); 1331 1353 int port = url.getPort(); 1332 1354 String path = url.getRawPath();
Note: See TracChangeset
for help on using the changeset viewer.