From 0d079bc7bf92e334af2795f367b9d3d9148f4f95 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 22 Dec 2014 10:44:31 +0100 Subject: [PATCH] rename to getBytes (IDEA-CR-1104) --- .../src/com/intellij/util/io/HttpRequests.java | 8 ++++---- .../plugins/groovy/ivy/AbstractAttachSourceProvider.java | 2 +- .../daemon/impl/quickfix/FetchExtResourceAction.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/platform-api/src/com/intellij/util/io/HttpRequests.java b/platform/platform-api/src/com/intellij/util/io/HttpRequests.java index 22abd66527bc..ed9add9363bb 100644 --- a/platform/platform-api/src/com/intellij/util/io/HttpRequests.java +++ b/platform/platform-api/src/com/intellij/util/io/HttpRequests.java @@ -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 { @@ -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() { @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); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/ivy/AbstractAttachSourceProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/ivy/AbstractAttachSourceProvider.java index 4ac53c2caab6..ed6febd98ff5 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/ivy/AbstractAttachSourceProvider.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/ivy/AbstractAttachSourceProvider.java @@ -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); diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java index 8078b06c6231..bfbd4a01b988 100644 --- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java +++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java @@ -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; }