Skip to content
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

adds files always directly under /conf/apm/scripts bug #292

Merged

Conversation

dprzybyl
Copy link
Collaborator

No description provided.

@@ -60,7 +60,7 @@ class ScriptUploadServlet : AbstractFormServlet<ScriptUploadForm>(ScriptUploadFo

override fun doPost(form: ScriptUploadForm, resourceResolver: ResourceResolver): ResponseEntity<Any> {
return try {
val script = scriptStorage.save(form.fileName, form.file, form.toLaunchMetadata(), form.overwrite, resourceResolver)
val script = scriptStorage.save(form.savePath, form.fileName, form.file, form.toLaunchMetadata(), form.overwrite, resourceResolver)
Copy link
Contributor

Choose a reason for hiding this comment

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

If you are already changing the interface here, I would try to minimize the number of arguments. 6 arguments in a method call are too much. In this case, you can pass the whole form as 5 out of 6 arguments comes from the form. However, this method comes from the interface so it may not be that easy to change it. If this method is used in different contexts where form is not available, you can try to use other techniques described here: https://refactoring.guru/pl/smells/long-parameter-list

@dprzybyl dprzybyl merged commit 6ce8437 into master Mar 15, 2021
@dprzybyl dprzybyl deleted the bugfix/adds-files-always-directly-under-conf-apm-scripts branch March 15, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants