-
Notifications
You must be signed in to change notification settings - Fork 65
Allow adding a large product #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@alexabird can you review this please? |
| ECLIPSE_MULTIPART_CONFIG, | ||
| new MultipartConfigElement(System.getProperty(JAVA_IO_TMPDIR))); | ||
| LOGGER.trace("POST Path: {}", CATALOG_PATH); | ||
| try { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ardasmax
left a comment
There was a problem hiding this 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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this bit is in AutoCloseableMultipartBodyFactory now
|
build now |
|
Internal build has been started, your results will be available at build completion. |
|
Build FAILURE See the job results in legacy Jenkins UI or in Blue Ocean UI. |
Suspected Failure(s):
|
| private static final String BYTES = "bytes"; | ||
|
|
||
| private static final String CATALOG_PATH = "/catalog/"; | ||
| private static final String CATALOG_ID_PATH = "/catalog/:id"; |
There was a problem hiding this comment.
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";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Conflicts: # ui-backend/catalog-ui-search/src/main/java/org/codice/ddf/catalog/ui/catalog/CatalogApplication.java
|
build now |
|
Internal build has been started, your results will be available at build completion. |
|
Build SUCCESS See the job results in legacy Jenkins UI or in Blue Ocean UI. |
# Conflicts: # pom.xml
|
@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 |
|
build now |
|
Internal build has been started, your results will be available at build completion. |
|
Build SUCCESS See the job results in legacy Jenkins UI or in Blue Ocean UI. |
This PR allows a large file upload (separate server settings might need to be updated to allow bigger files and longer time out).