mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rename to getBytes (IDEA-CR-1104)
This commit is contained in:
@@ -66,7 +66,7 @@ public abstract class HttpRequests {
|
||||
@NotNull
|
||||
File saveToFile(@NotNull File file, @Nullable ProgressIndicator indicator) throws IOException;
|
||||
|
||||
byte[] toBytes(@Nullable ProgressIndicator indicator) throws IOException;
|
||||
byte[] getBytes(@Nullable ProgressIndicator indicator) throws IOException;
|
||||
}
|
||||
|
||||
public interface RequestProcessor<T> {
|
||||
@@ -175,11 +175,11 @@ public abstract class HttpRequests {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public byte[] toBytes(@Nullable final ProgressIndicator indicator) throws IOException {
|
||||
public byte[] getBytes(@Nullable final ProgressIndicator indicator) throws IOException {
|
||||
return connect(new HttpRequests.RequestProcessor<byte[]>() {
|
||||
@Override
|
||||
public byte[] process(@NotNull HttpRequests.Request request) throws IOException {
|
||||
return request.toBytes(indicator);
|
||||
return request.getBytes(indicator);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public abstract class HttpRequests {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public byte[] toBytes(@Nullable ProgressIndicator indicator) throws IOException {
|
||||
public byte[] getBytes(@Nullable ProgressIndicator indicator) throws IOException {
|
||||
int contentLength = getConnection().getContentLength();
|
||||
BufferExposingByteArrayOutputStream out = new BufferExposingByteArrayOutputStream(contentLength > 0 ? contentLength : 32 * 1024);
|
||||
NetUtils.copyStreamContent(indicator, getInputStream(), out, contentLength);
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ public abstract class AbstractAttachSourceProvider implements AttachSourcesProvi
|
||||
try {
|
||||
LOG.info("Downloading sources JAR: " + myUrl);
|
||||
indicator.checkCanceled();
|
||||
bytes = HttpRequests.request(myUrl).toBytes(indicator);
|
||||
bytes = HttpRequests.request(myUrl).getBytes(indicator);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.warn(e);
|
||||
|
||||
+1
-1
@@ -521,7 +521,7 @@ public class FetchExtResourceAction extends BaseExtResourceAction implements Wat
|
||||
@Override
|
||||
public FetchResult process(@NotNull HttpRequests.Request request) throws IOException {
|
||||
FetchResult result = new FetchResult();
|
||||
result.bytes = request.toBytes(indicator);
|
||||
result.bytes = request.getBytes(indicator);
|
||||
result.contentType = request.getConnection().getContentType();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user