Skip to content

Commit 82c8916

Browse files
Deleted old MultiPartFormData.onParts() logic for consuming multiparts
1 parent 940a347 commit 82c8916

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

ng-adaptor-jetty/src/main/java/ng/adaptor/jetty/NGAdaptorJetty.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -276,53 +276,6 @@ private static NGRequest multipartRequestToNGRequest( final Request jettyRequest
276276
list.add( parameterValue );
277277
} );
278278

279-
// FIXME: Old method of getting the parts // Hugi 2025-07-19
280-
// MultiPartFormData.onParts( jettyRequest, jettyRequest, contentType, config, new Promise.Invocable<MultiPartFormData.Parts>() {
281-
//
282-
// @Override
283-
// public void succeeded( MultiPartFormData.Parts parts ) {
284-
// parts.forEach( p -> {
285-
// final String partContentType = p.getHeaders().get( HttpHeader.CONTENT_TYPE );
286-
//
287-
// final String parameterName = p.getName();
288-
// final String parameterValue;
289-
//
290-
// // We're assuming that if this part does not have a content type, it's a regular ol' form value, to be added to the requests formValues map as usual.
291-
// if( partContentType == null ) {
292-
// parameterValue = p.getContentAsString( StandardCharsets.UTF_8 ); // FIXME: Hardcoding the character set is a little presumptuous // Hugi 2025-04-05
293-
// }
294-
// else {
295-
// // We're generating a unique ID here to store the attachment under in the request. This value will be stored in the request's formValues, and can be used to fetch the uploaded data in the request's uploadedFiles map
296-
// final String uniqueID = UUID.randomUUID().toString();
297-
//
298-
// parameterValue = uniqueID;
299-
//
300-
// // Now we add the uploaded file to the request
301-
// final UploadedFile file = new UploadedFile( p.getFileName(), partContentType, Content.Source.asInputStream( p.getContentSource() ), p.getLength() );
302-
// uploadedFiles.put( uniqueID, file );
303-
// }
304-
//
305-
// List<String> list = formValues.get( parameterName );
306-
//
307-
// if( list == null ) {
308-
// list = new ArrayList<>();
309-
// formValues.put( p.getName(), list );
310-
// }
311-
//
312-
// list.add( parameterValue );
313-
// } );
314-
// }
315-
//
316-
// @Override
317-
// public void failed( Throwable failure ) {
318-
// // FIXME: This is here temporarily for some debugging. We should have better error handling overall for multipart uploads // Hugi 2025-07-19
319-
// System.out.println( "================ Start multipart fail =====================" );
320-
// failure.printStackTrace();
321-
// System.out.println( "================ End multipart fail =====================" );
322-
// // throw new RuntimeException( failure );
323-
// }
324-
// } );
325-
326279
final String method = jettyRequest.getMethod();
327280
final String uri = jettyRequest.getHttpURI().getCanonicalPath();
328281
final String httpVersion = jettyRequest.getConnectionMetaData().getHttpVersion().asString();

0 commit comments

Comments
 (0)