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.
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
#130: Add default content length to progress bar #286
#130: Add default content length to progress bar #286
Changes from 13 commits
a6799be
be68571
82a521f
72b90ef
7c81d4a
2651706
301b5bb
483311d
c4e6d0a
a95ac8d
1729d2e
0ad0b7b
356f7ec
9886857
368f3a1
2526187
d931dff
7ac7fa4
f7205aa
1ecce2b
fc4b554
50d38c4
8dccee1
acf8e96
ba27c39
f3ccb0a
df01ffe
5a146b1
c13439d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
if you need to test this somehow, extract to protected method
long getFileSize(Path)
create a subclass ofFileAccessImpl
for test that overrides and returns0
instead. Then in your JUnit replace the realFileAccess
with the test instance... Seems a little bit more complicated but adding thistest
flag to our official API seems odd 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.
I've implemented this as you've suggested, thanks.
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.
why are you using
0
for undefined? IMHO-1
would make more sense also here...Files can be
0
bytes large and then the user should not get this warning for every file that was empty but gets copied.Also if the file size is know but smaller than e.g. 1k we should not give a progress bar.
What is good is that we have a dedicated method
copyFileWithProgressBar
for this use-case so we do not do this for every file. However, I assume this is used when we get a tool release package from a custom tool repository using a file URL and that can also be a network mount that is slower so already copying 1MB could take some seconds...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've set the default for undefined to -1 now.