Skip to content

Commit b936335

Browse files
author
Stephane Landelle
committed
Collapse static imports
1 parent f6fa139 commit b936335

File tree

11 files changed

+28
-25
lines changed

11 files changed

+28
-25
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/Constants.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.channel;
1717

18-
import static org.asynchttpclient.providers.netty.util.HttpUtil.*;
18+
import static org.asynchttpclient.providers.netty.util.HttpUtil.HTTP;
19+
import static org.asynchttpclient.providers.netty.util.HttpUtil.WEBSOCKET;
20+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isSecure;
1921
import io.netty.bootstrap.Bootstrap;
2022
import io.netty.channel.Channel;
2123
import io.netty.channel.ChannelHandlerContext;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/future/NettyResponseFuture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.future;
1717

18-
import static org.asynchttpclient.util.DateUtil.*;
18+
import static org.asynchttpclient.util.DateUtil.millisTime;
1919
import io.netty.channel.Channel;
2020
import io.netty.handler.codec.http.HttpHeaders;
2121
import io.netty.handler.codec.http.HttpResponse;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/HttpProtocol.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.handler;
1717

18-
import static io.netty.handler.codec.http.HttpResponseStatus.*;
19-
import static org.asynchttpclient.providers.netty.util.HttpUtil.*;
18+
import static io.netty.handler.codec.http.HttpResponseStatus.CONTINUE;
19+
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
20+
import static io.netty.handler.codec.http.HttpResponseStatus.PROXY_AUTHENTICATION_REQUIRED;
21+
import static io.netty.handler.codec.http.HttpResponseStatus.UNAUTHORIZED;
22+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isNTLM;
2023
import io.netty.buffer.ByteBuf;
2124
import io.netty.channel.ChannelHandlerContext;
2225
import io.netty.handler.codec.http.HttpContent;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/Protocol.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
*/
1313
package org.asynchttpclient.providers.netty.handler;
1414

15-
import static io.netty.handler.codec.http.HttpResponseStatus.*;
16-
import static org.asynchttpclient.providers.netty.util.HttpUtil.*;
15+
import static io.netty.handler.codec.http.HttpResponseStatus.FOUND;
16+
import static io.netty.handler.codec.http.HttpResponseStatus.MOVED_PERMANENTLY;
17+
import static io.netty.handler.codec.http.HttpResponseStatus.SEE_OTHER;
18+
import static io.netty.handler.codec.http.HttpResponseStatus.TEMPORARY_REDIRECT;
19+
import static org.asynchttpclient.providers.netty.util.HttpUtil.HTTP;
20+
import static org.asynchttpclient.providers.netty.util.HttpUtil.WEBSOCKET;
1721
import io.netty.channel.ChannelHandlerContext;
1822
import io.netty.handler.codec.http.HttpHeaders;
1923
import io.netty.handler.codec.http.HttpMethod;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/WebSocketProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.handler;
1717

18-
import static io.netty.handler.codec.http.HttpResponseStatus.*;
18+
import static io.netty.handler.codec.http.HttpResponseStatus.SWITCHING_PROTOCOLS;
1919
import io.netty.buffer.ByteBuf;
2020
import io.netty.channel.ChannelHandlerContext;
2121
import io.netty.handler.codec.http.HttpHeaders;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequestSender.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.request;
1717

18-
import static org.asynchttpclient.providers.netty.util.HttpUtil.*;
18+
import static org.asynchttpclient.providers.netty.util.HttpUtil.WEBSOCKET;
19+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isSecure;
1920
import io.netty.bootstrap.Bootstrap;
2021
import io.netty.channel.Channel;
2122
import io.netty.channel.ChannelFuture;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.request;
1717

18-
import static org.asynchttpclient.providers.netty.util.HttpUtil.*;
19-
import static org.asynchttpclient.util.AsyncHttpProviderUtils.*;
20-
import static org.asynchttpclient.util.MiscUtil.*;
18+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isNTLM;
19+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isSecure;
20+
import static org.asynchttpclient.providers.netty.util.HttpUtil.isWebSocket;
21+
import static org.asynchttpclient.util.AsyncHttpProviderUtils.DEFAULT_CHARSET;
22+
import static org.asynchttpclient.util.MiscUtil.isNonEmpty;
2123
import io.netty.buffer.Unpooled;
2224
import io.netty.handler.codec.http.DefaultFullHttpRequest;
2325
import io.netty.handler.codec.http.DefaultHttpRequest;

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/body/NettyFileBody.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.io.RandomAccessFile;
2929

3030
import org.asynchttpclient.AsyncHttpClientConfig;
31-
import org.asynchttpclient.providers.netty.Constants;
3231
import org.asynchttpclient.providers.netty.channel.Channels;
3332
import org.asynchttpclient.providers.netty.future.NettyResponseFuture;
3433
import org.asynchttpclient.providers.netty.request.ProgressListener;
@@ -39,6 +38,8 @@ public class NettyFileBody implements NettyBody {
3938

4039
private static final Logger LOGGER = LoggerFactory.getLogger(NettyFileBody.class);
4140

41+
public final static int MAX_BUFFERED_BYTES = 8192;
42+
4243
private final File file;
4344
private final long offset;
4445
private final long length;
@@ -81,7 +82,7 @@ public void write(Channel channel, NettyResponseFuture<?> future, AsyncHttpClien
8182
try {
8283
ChannelFuture writeFuture;
8384
if (Channels.getSslHandler(channel) != null) {
84-
writeFuture = channel.write(new ChunkedFile(raf, offset, length, Constants.MAX_BUFFERED_BYTES), channel.newProgressivePromise());
85+
writeFuture = channel.write(new ChunkedFile(raf, offset, length, MAX_BUFFERED_BYTES), channel.newProgressivePromise());
8586
} else {
8687
FileRegion region = new DefaultFileRegion(raf.getChannel(), offset, length);
8788
writeFuture = channel.write(region, channel.newProgressivePromise());

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/timeout/IdleConnectionTimeoutTimerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.asynchttpclient.providers.netty.request.timeout;
1717

18-
import static org.asynchttpclient.util.DateUtil.*;
18+
import static org.asynchttpclient.util.DateUtil.millisTime;
1919
import io.netty.util.Timeout;
2020

2121
import java.util.concurrent.atomic.AtomicBoolean;

0 commit comments

Comments
 (0)