Added a new DownloadProgress class to Get.java to display a progress bar.#224
Added a new DownloadProgress class to Get.java to display a progress bar.#224FrancesTwisk wants to merge 5 commits intoapache:masterfrom
Conversation
| } | ||
|
|
||
| public void printProgressBar(int downloadedBytesPercentage, double downloadSpeed) { | ||
| int size = 50; |
There was a problem hiding this comment.
Is dit ook mogelijk?
const int size = 50;
There was a problem hiding this comment.
Ah, sorry. Should not have written that in Dutch! I asked here whether "const" could be added to the definition of variable size.
There was a problem hiding this comment.
const is not a keyword in Java I think, but since the size variable doesn't change I can add the final keyword.
| private String userAgent = | ||
| System.getProperty(MagicNames.HTTP_AGENT_PROPERTY, | ||
| DEFAULT_AGENT_PREFIX + "/" | ||
| + Main.getShortAntVersion()); |
There was a problem hiding this comment.
You have a lot of changes that are only styling. Some developers do not like that because it makes reviewing harder. And maybe the styling that the developers of this project want is different from what you are doing here.
There was a problem hiding this comment.
I agree, I see this is mentioned in the https://github.com/apache/ant/blob/master/CONTRIBUTING.md
There was a problem hiding this comment.
Yes you're right thank you, I removed all those unnecessary spaces.
| private String userAgent = | ||
| System.getProperty(MagicNames.HTTP_AGENT_PROPERTY, | ||
| DEFAULT_AGENT_PREFIX + "/" | ||
| + Main.getShortAntVersion()); |
There was a problem hiding this comment.
I agree, I see this is mentioned in the https://github.com/apache/ant/blob/master/CONTRIBUTING.md
| private final Resources sources = new Resources(); | ||
| private File destination; // required | ||
| private boolean verbose = false; | ||
| private boolean progressbar = false; |
There was a problem hiding this comment.
Can we not simply replace the dots with a progress bar? So when verbose="true" show a progress bar instead of dots. Or would some people prefer the dots? My feeling is that this is not the case but maybe it's good to discuss this on the dev list, see https://github.com/apache/ant/blob/master/CONTRIBUTING.md too
There was a problem hiding this comment.
Good idea, I changed it so a progressbar is the default when verbose, but still kept the option for users that prefer the dots.
…o add-progressbar-to-get-task # Conflicts: # src/main/org/apache/tools/ant/taskdefs/Get.java
Added a new DownloadProgress class in Get.Java so when progressbar="on" is set in an get-task it shows a progress bar, remaining time and download speed for extra information besides the verbose option.
