[ 
https://issues.apache.org/jira/browse/IO-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17901311#comment-17901311
 ] 

Gary D. Gregory commented on IO-865:
------------------------------------

Hello [~nicostrecker] 

To help clean this up and make the API to bit more flexible, use git master or 
a 2.19.0 snapshot build from 
https://repository.apache.org/content/repositories/snapshots/

 {code:java}
 ThrottledInputStream in = ThrottledInputStream.builder()
   .setPath(Paths.get("MyFile.xml"))
   .setMaxBytes(100_000, ChronoUnit.SECONDS)
   .get();
{code}


> ThrottledInputStream.Builder does not return builder instance for 
> setMaxBytesPerSecond()
> ----------------------------------------------------------------------------------------
>
>                 Key: IO-865
>                 URL: https://issues.apache.org/jira/browse/IO-865
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.18.0
>            Reporter: Nico Strecker
>            Priority: Minor
>
> The ThrottledInputStream documentation contains the following example:
> {code:java}
> ThrottledInputStream in = ThrottledInputStream.builder()
>   .setInputStream(inputStream)
>   .setMaxBytesPerSecond(100_000)
>   .get();{code}
> This example does not work because setMaxBytesPerSecond does not return the 
> builder instance but void:
> {code:java}
> public void setMaxBytesPerSecond(final long maxBytesPerSecond) {
>     this.maxBytesPerSecond = maxBytesPerSecond;
> } {code}
> Either we correct the documentation or we return the builder instance, which 
> I would prefer.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to