Skip to content

Commit

Permalink
Fixes issue #2282 - Refactor multipart support (#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Dec 28, 2021
1 parent b206820 commit 6f0fb8c
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import cloud.piranha.core.api.AttributeManager;
import cloud.piranha.core.api.HttpHeaderManager;
import cloud.piranha.core.api.HttpSessionManager;
import cloud.piranha.core.api.MultiPartManager;
import cloud.piranha.core.api.WebApplication;
import cloud.piranha.core.api.WebApplicationRequest;
import static cloud.piranha.core.impl.DefaultServletRequestDispatcher.PREVIOUS_REQUEST;
Expand Down Expand Up @@ -206,11 +205,6 @@ public class DefaultWebApplicationRequest extends ServletInputStream implements
* Stores the multipart config.
*/
protected MultipartConfigElement multipartConfig;

/**
* Stores the multipart manager.
*/
protected MultiPartManager multipartManager;

/**
* Stores the parameters.
Expand Down Expand Up @@ -740,16 +734,16 @@ private String mergeQueryFromAttributes() {
@Override
public Part getPart(String name) throws IOException, ServletException {
verifyMultipartFormData();
return multipartManager != null
? multipartManager.getPart(webApplication, this, name)
return webApplication.getMultiPartManager() != null
? webApplication.getMultiPartManager().getPart(webApplication, this, name)
: null;
}

@Override
public Collection<Part> getParts() throws IOException, ServletException {
verifyMultipartFormData();
return multipartManager != null
? multipartManager.getParts(webApplication, this)
return webApplication.getMultiPartManager() != null
? webApplication.getMultiPartManager().getParts(webApplication, this)
: Collections.EMPTY_LIST;
}

Expand Down

0 comments on commit 6f0fb8c

Please sign in to comment.