Rename HttpDataFactory.*datas to *data. Fixes #2094

This commit is contained in:
Michael Nitschinger 2014-01-16 09:30:17 +01:00 committed by Trustin Lee
parent 1d577a8d95
commit 574480e332
6 changed files with 17 additions and 15 deletions

View File

@ -34,6 +34,7 @@ import java.util.Map;
* according to the constructor.
*/
public class DefaultHttpDataFactory implements HttpDataFactory {
/**
* Proposed default MINSIZE as 16 KB.
*/
@ -54,7 +55,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
private Charset charset = HttpConstants.DEFAULT_CHARSET;
/**
* Keep all HttpDatas until cleanAllHttpDatas() is called.
* Keep all HttpDatas until cleanAllHttpData() is called.
*/
private final Map<HttpRequest, List<HttpData>> requestFileDeleteMap = PlatformDependent.newConcurrentHashMap();
@ -222,7 +223,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
@Override
public void cleanRequestHttpDatas(HttpRequest request) {
public void cleanRequestHttpData(HttpRequest request) {
List<HttpData> fileToDelete = requestFileDeleteMap.remove(request);
if (fileToDelete != null) {
for (HttpData data: fileToDelete) {
@ -233,7 +234,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
@Override
public void cleanAllHttpDatas() {
public void cleanAllHttpData() {
for (HttpRequest request : requestFileDeleteMap.keySet()) {
List<HttpData> fileToDelete = requestFileDeleteMap.get(request);
if (fileToDelete != null) {

View File

@ -23,6 +23,7 @@ import java.nio.charset.Charset;
* Interface to enable creation of InterfaceHttpData objects
*/
public interface HttpDataFactory {
/**
* To set a max size limitation on fields. Exceeding it will generate an ErrorDataDecoderException.
* A value of -1 means no limitation (default).
@ -64,10 +65,10 @@ public interface HttpDataFactory {
*
* @param request associated request
*/
void cleanRequestHttpDatas(HttpRequest request);
void cleanRequestHttpData(HttpRequest request);
/**
* Remove all InterfaceHttpData from virtual File storage from clean list for all requests
*/
void cleanAllHttpDatas();
void cleanAllHttpData();
}

View File

@ -914,7 +914,7 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest
public void cleanFiles() {
checkDestroyed();
factory.cleanRequestHttpDatas(request);
factory.cleanRequestHttpData(request);
}
/**

View File

@ -213,7 +213,7 @@ public class HttpPostRequestEncoder implements ChunkedInput<HttpContent> {
* Clean all HttpDatas (on Disk) for the current request.
*/
public void cleanFiles() {
factory.cleanRequestHttpDatas(request);
factory.cleanRequestHttpData(request);
}
/**

View File

@ -718,7 +718,7 @@ public class HttpPostStandardRequestDecoder implements InterfaceHttpPostRequestD
public void cleanFiles() {
checkDestroyed();
factory.cleanRequestHttpDatas(request);
factory.cleanRequestHttpData(request);
}
/**

View File

@ -130,14 +130,14 @@ public class HttpUploadClient {
// Simple Get form: no factory used (not usable)
List<Entry<String, String>> headers = formGet(b, host, port, get, uriSimple);
if (headers == null) {
factory.cleanAllHttpDatas();
factory.cleanAllHttpData();
return;
}
// Simple Post form: factory used for big attributes
List<InterfaceHttpData> bodylist = formPost(b, host, port, uriSimple, file, factory, headers);
if (bodylist == null) {
factory.cleanAllHttpDatas();
factory.cleanAllHttpData();
return;
}
@ -148,7 +148,7 @@ public class HttpUploadClient {
group.shutdownGracefully();
// Really clean all temporary files if they still exist
factory.cleanAllHttpDatas();
factory.cleanAllHttpData();
}
}