Skip to content

Conversation

@e-hosea
Copy link

@e-hosea e-hosea commented Sep 16, 2025

This PR allows a large file upload (separate server settings might need to be updated to allow bigger files and longer time out).

@e-hosea
Copy link
Author

e-hosea commented Dec 4, 2025

@alexabird can you review this please?

ECLIPSE_MULTIPART_CONFIG,
new MultipartConfigElement(System.getProperty(JAVA_IO_TMPDIR)));
LOGGER.trace("POST Path: {}", CATALOG_PATH);
try {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this out into it's own private function that returns a response object

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

new ByteArrayInputStream(req.bodyAsBytes()));
res.status(HttpStatus.SC_NOT_FOUND);
return res;
} catch (Exception e) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd catch more specific exceptions here, CatalogServiceExceptions get caught and handled by the addDocument() calls. I think we only need to catch the IOExceptions and ServletExceptions thrown by the MultipartBodyFactory.create() method

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private String mapHome = "";

private int maximumUploadSize = 1_048_576;
private long maximumUploadSize = 1_048_576L;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put a comment here like the other variables you've added

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

part.delete();
LOGGER.debug("Temporary file '{}' deleted successfully", part.getName());
}
} catch (Exception e) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just catch an IOException here, it's the only exception part.delete() throws

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

@ardasmax ardasmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Liz, looking through the aus one now

CATALOG_PATH,
(req, res) -> {
if (req.contentType().startsWith("multipart/")) {
req.attribute(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentionally not included in the handleCatalogPost?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexabird alexabird marked this pull request as ready for review December 5, 2025 01:30
@alexabird
Copy link
Collaborator

build now

@cxddfuibot
Copy link
Collaborator

Internal build has been started, your results will be available at build completion.

@cxddfuibot
Copy link
Collaborator

Build FAILURE See the job results in legacy Jenkins UI or in Blue Ocean UI.

@cxddfuibot
Copy link
Collaborator

Suspected Failure(s):

  • Code Formatting Violations (fmt-maven-plugin)

private static final String BYTES = "bytes";

private static final String CATALOG_PATH = "/catalog/";
private static final String CATALOG_ID_PATH = "/catalog/:id";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do
private static final String CATALOG_ID_PATH = CATALOG_PATH + ":id";

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@e-hosea
Copy link
Author

e-hosea commented Dec 7, 2025

build now

@cxddfuibot
Copy link
Collaborator

Internal build has been started, your results will be available at build completion.

@cxddfuibot
Copy link
Collaborator

Build SUCCESS See the job results in legacy Jenkins UI or in Blue Ocean UI.

@e-hosea
Copy link
Author

e-hosea commented Dec 12, 2025

@ardasmax @alexabird The refactoring of AutoCloseableMultipartBody/Factory into multipart-utils module is done. Can you please have a quick review in regards to that? Thanks

@e-hosea
Copy link
Author

e-hosea commented Dec 12, 2025

build now

@cxddfuibot
Copy link
Collaborator

Internal build has been started, your results will be available at build completion.

@cxddfuibot
Copy link
Collaborator

Build SUCCESS See the job results in legacy Jenkins UI or in Blue Ocean UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants