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

Adding feature to configure upload size with annotation #785

Merged
merged 12 commits into from
Sep 10, 2014

Conversation

garcia-jj
Copy link
Member

Because there are some times we want to configure upload size with different values for another method. Or we want to configure a value without overriding a class.

If you like it, I'll add documentation.

@rponte
Copy link
Contributor

rponte commented Sep 5, 2014

Nice and useful feature!

On Fri, Sep 5, 2014 at 4:33 AM, Otávio Garcia notifications@github.com
wrote:

Because there are some times we want to configure upload size with
different values for another method. Or we want to configure a value
without overriding a class.

If you like it, I'll add documentation.

You can merge this Pull Request by running

git pull https://github.com/caelum/vraptor4 ot-uploadsize

Or view, comment on, or merge it at:

#785
Commit Summary

  • Extracting upload size to class constants
  • Adding getAnnotation method to ControllerMethod
  • Adding feature to configure upload size with annotation
  • Fixing indentation

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#785.

Rafael Ponte
TriadWorks | Formação Java
http://cursos.triadworks.com.br

uploader.setSizeMax(config.getSizeLimit());
uploader.setFileSizeMax(config.getFileSizeLimit());

UploadSizeLimit uploadSizeLimit = event.getMethod().getAnnotation(UploadSizeLimit.class);
Copy link
Member

Choose a reason for hiding this comment

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

what do you think of changing to event.getMethodAnnotation(...)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so because we already have a method called getAnnotations. Because of this, I think that methods needs to get the same name pattern.

Copy link
Member

Choose a reason for hiding this comment

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

so event.getAnnotation(...)...

@Turini
Copy link
Member

Turini commented Sep 9, 2014

only missing docs, after adding it :shipit:

@garcia-jj
Copy link
Member Author

Right. I'll soon. Thank you.

@garcia-jj
Copy link
Member Author

@Turini @lucascs I did some docs changes about this feature, only in english until now. What you think? 6ce19e2

@garcia-jj
Copy link
Member Author

I have changed some words in the docs to make it more easily to understand. Let me know if the text are good, or if need more improvements. Thank you devs.

garcia-jj added a commit that referenced this pull request Sep 10, 2014
Adding feature to configure upload size with annotation
@garcia-jj garcia-jj merged commit cd99435 into master Sep 10, 2014
@garcia-jj garcia-jj deleted the ot-uploadsize branch September 10, 2014 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants