Skip to content

Commit

Permalink
Modify and add class comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bidetofevil committed Oct 30, 2023
1 parent 7667ac6 commit 0ca956f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

import javax.net.ssl.SSLPeerUnverifiedException;

/**
* An interface that duplicates the functionality of HttpURLConnection whose implementation can then wrap an actual HttpURLConnection's
* implementation so calls can be forwarded from this interface's implementation to the wrapped HttpURLConnection implementation.
* Having this separate interface allows the actual wrappers ({@link EmbraceHttpUrlConnectionImpl}/{@link EmbraceHttpsUrlConnectionImpl})
* to share an implementation whilst exposing separate interfaces for what they're wrapping.
*/
interface EmbraceHttpUrlConnection {

void addRequestProperty(@NonNull String key, @Nullable String value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import java.util.List;
import java.util.Map;

/**
* An implementation of HttpURLConnection that forwards calls to an {@link EmbraceUrlConnectionDelegate}
*/
class EmbraceHttpUrlConnectionImpl<T extends HttpURLConnection> extends HttpURLConnection {

private final EmbraceHttpUrlConnection embraceHttpUrlConnectionDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import javax.net.ssl.SSLSocketFactory;

/**
* Additional methods for HTTPS network calls
* {@link EmbraceHttpUrlConnection} plus additional methods for HTTPS network calls
*/
interface EmbraceHttpsUrlConnection extends EmbraceHttpUrlConnection {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import kotlin.jvm.functions.Function0;

/**
* Wraps @{link HttpUrlConnection} to log network calls to Embrace. The wrapper also wraps the
* Wraps {@link HttpURLConnection} to log network calls to Embrace. The wrapper also wraps the
* InputStream to get an accurate count of bytes received if a Content-Length is not provided by
* the server.
* <p>
Expand Down

0 comments on commit 0ca956f

Please sign in to comment.