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

Add some docs for Cache class #4375

Merged
merged 3 commits into from
Nov 7, 2018
Merged

Add some docs for Cache class #4375

merged 3 commits into from
Nov 7, 2018

Conversation

Jawnnypoo
Copy link
Contributor

I was looking into the docs and could not see from the constructor what the size was in terms of. Turns out it is bytes. Hopefully this will help others save a step on figuring this out 😉

* Create a cache which will reside in {@code directory}.
*
* @param directory a writable directory
* @param maxSize the maximum number of bytes this cache should use to store
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you add {@code maxSize} in the sentence above you can drop these two @param tags. Maybe Create a cache of at most {@code maxSize} bytes in {@code directory}.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! Updated

@@ -379,6 +382,7 @@ public long size() throws IOException {
return cache.size();
}

/** Max size of the cache (in bytes). */

Choose a reason for hiding this comment

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

@return?

@swankjesse swankjesse merged commit 495b5f7 into square:master Nov 7, 2018
@Jawnnypoo Jawnnypoo deleted the cache-docs branch November 7, 2018 15:52
SeniorZhai added a commit to SeniorZhai/okhttp that referenced this pull request Nov 15, 2018
* commit '1f7e796e6e658df34a98276b2092a81de118937d':
  Cleanup HttpLoggingInterceptor (square#4346)
  Add a LoggingEventListener and use it in okcurl (square#4353)
  Preemptive auth for proxy CONNECT
  Relax handling of Cache-Control: immutable
  Add some docs for Cache class (square#4375)
  Fix connection leaks on failed web socket upgrades.
  Don't specify a crypto provider in HeldCertificate.
  Confirm that call timeouts don't apply to SSE or web sockets.
  Add APIs to configure the client's default call timeout. (square#4369)
  Recover from executor shutdowns gracefully. (square#4365)
  Make the nested BasicAuthInterceptor static (square#4368)
  Add basic auth interceptor recipe (square#4336)
  Whole operation timeouts
  Make scheme names case-sensitive again.
  Remove colon when scheme missing in builder toString (square#4361)
  CipherSuite init speedup (square#4340)
  Limit the use of regexes in the RFC 7235 challenge parser.
  Allow incomplete url builder toString usage (square#4357)
  APIs to set date headers
  Upgrade Conscrypt to 1.4.0 (was 1.3.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants