-
Notifications
You must be signed in to change notification settings - Fork 18
SLING-13202 Remove dependency on commons-fileupload #75
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
Open
enapps-enorman
wants to merge
7
commits into
apache:master
Choose a base branch
from
enapps-enorman:issue/SLING-13202
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac00012
SLING-13202 Remove dependency on commons-fileupload
enapps-enorman 5aca587
SLING-13202 cleanup comment
enapps-enorman bedd1f5
SLING-13202 resolve sonar warnings and tests for code coverage
enapps-enorman 39c4d72
SLING-13202 more tests for code coverage
enapps-enorman 4f84a18
SLING-13202 even more tests for code coverage
enapps-enorman 6efb03f
SLING-13202 incorporate changes requested by code review
enapps-enorman 5020c47
SLING-13202 pass the mulitpart maxFileCount value to the servlet config
enapps-enorman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/org/apache/sling/engine/impl/parameters/FileCountLimitExceededException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.sling.engine.impl.parameters; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * This exception is thrown if a request contains more files than the specified | ||
| * limit. | ||
| */ | ||
| public class FileCountLimitExceededException extends IOException { | ||
|
|
||
| private static final long serialVersionUID = 6904179610227521789L; | ||
|
|
||
| /** | ||
| * The limit that was exceeded. | ||
| */ | ||
| private final long limit; | ||
|
|
||
| /** | ||
| * Creates a new instance. | ||
| * | ||
| * @param message The detail message | ||
| * @param limit The limit that was exceeded | ||
| */ | ||
| public FileCountLimitExceededException(final String message, final long limit) { | ||
| super(message); | ||
| this.limit = limit; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the limit that was exceeded. | ||
| * | ||
| * @return The limit that was exceeded by the request | ||
| */ | ||
| public long getLimit() { | ||
| return limit; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: do we need transient?
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.
Without this modifier, sonar reports it as a violation of rule "java:S1948" with this reason:
Fields in a "Serializable" class should either be transient or serializableThere 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 personally think that this we should ignore such default sonar reports. While this makes sense in general for Serializable objects, it does imho not make sense for Servlets (or any other service). These objects will never be serialized and therefore this just clutters the code
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.
It doesn't bother me either way which is why I usually just change it to satisfy sonar. I have no idea how I would go about changing the sonar rules for specific "serializable" types for this or other sling projects. Please tell me how I would accomplish that.
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.
no idea, but I wouldnt blindly apply sonar suggestions and just apply the ones which make sense to me.
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.
@cziegeler That's the mindset that leads to projects having hundreds or thousands of unresolved warnings. When it gets to that state the real problems get lost in the noise. So I always make a best effort to have all the code I work on have no warnings.
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 have seen dozens of such changes in general which actually made the code worse just to get rid off warnings in some tool. Lets agree that transient in this case is not needed, but it doesnt hurt either. So lets just move on..