|
Lines 29-35
Link Here
|
| 29 |
|
29 |
|
| 30 |
public InputStream getInputStream() throws IOException { |
30 |
public InputStream getInputStream() throws IOException { |
| 31 |
if (in == null && url != null) { |
31 |
if (in == null && url != null) { |
| 32 |
connection = url.openConnection(); |
32 |
if (connection == null) |
|
|
33 |
connection = url.openConnection(); |
| 33 |
if (offset > 0) |
34 |
if (offset > 0) |
| 34 |
connection.setRequestProperty("Range", "bytes=" + offset + "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
35 |
connection.setRequestProperty("Range", "bytes=" + offset + "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 35 |
in = connection.getInputStream(); |
36 |
in = connection.getInputStream(); |
|
Lines 43-49
Link Here
|
| 43 |
public InputStream getInputStream(IProgressMonitor monitor) |
44 |
public InputStream getInputStream(IProgressMonitor monitor) |
| 44 |
throws IOException, CoreException { |
45 |
throws IOException, CoreException { |
| 45 |
if (in == null && url != null) { |
46 |
if (in == null && url != null) { |
| 46 |
connection = url.openConnection(); |
47 |
if (connection == null) |
|
|
48 |
connection = url.openConnection(); |
| 47 |
if (offset > 0) |
49 |
if (offset > 0) |
| 48 |
connection.setRequestProperty("Range", "bytes=" + offset + "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
50 |
connection.setRequestProperty("Range", "bytes=" + offset + "-"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 49 |
|
51 |
|
|
Lines 125-130
Link Here
|
| 125 |
for (;;) { |
127 |
for (;;) { |
| 126 |
if (monitor.isCanceled()) { |
128 |
if (monitor.isCanceled()) { |
| 127 |
runnable.disconnect(); |
129 |
runnable.disconnect(); |
|
|
130 |
connection = null; |
| 128 |
break; |
131 |
break; |
| 129 |
} |
132 |
} |
| 130 |
if (runnable.getInputStream() != null) { |
133 |
if (runnable.getInputStream() != null) { |