rename to getBytes (IDEA-CR-1104)

This commit is contained in:
Vladimir Krivosheev
2014-12-22 10:45:18 +01:00
parent 7001ba59fb
commit 0d079bc7bf
3 changed files with 6 additions and 6 deletions
@@ -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);
@@ -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);
@@ -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;
}