-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12d5d18
commit a05efba
Showing
436 changed files
with
6,796 additions
and
1,865 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/com/schematic/api/core/ResponseBodyInputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.schematic.api.core; | ||
|
||
import java.io.FilterInputStream; | ||
import java.io.IOException; | ||
import okhttp3.Response; | ||
|
||
/** | ||
* A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the | ||
* OkHttp Response object is properly closed when the stream is closed. | ||
* | ||
* This class extends FilterInputStream and takes an OkHttp Response object as a parameter. | ||
* It retrieves the InputStream from the Response and overrides the close method to close | ||
* both the InputStream and the Response object, ensuring proper resource management and preventing | ||
* premature closure of the underlying HTTP connection. | ||
*/ | ||
public class ResponseBodyInputStream extends FilterInputStream { | ||
private final Response response; | ||
|
||
/** | ||
* Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp | ||
* Response object. | ||
* | ||
* @param response the OkHttp Response object from which the InputStream is retrieved | ||
* @throws IOException if an I/O error occurs while retrieving the InputStream | ||
*/ | ||
public ResponseBodyInputStream(Response response) throws IOException { | ||
super(response.body().byteStream()); | ||
this.response = response; | ||
} | ||
|
||
/** | ||
* Closes the InputStream and the associated OkHttp Response object. This ensures that the | ||
* underlying HTTP connection is properly closed after the stream is no longer needed. | ||
* | ||
* @throws IOException if an I/O error occurs | ||
*/ | ||
@Override | ||
public void close() throws IOException { | ||
super.close(); | ||
response.close(); // Ensure the response is closed when the stream is closed | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/schematic/api/core/ResponseBodyReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.schematic.api.core; | ||
|
||
import java.io.FilterReader; | ||
import java.io.IOException; | ||
import okhttp3.Response; | ||
|
||
/** | ||
* A custom Reader that wraps the Reader from the OkHttp Response and ensures that the | ||
* OkHttp Response object is properly closed when the reader is closed. | ||
* | ||
* This class extends FilterReader and takes an OkHttp Response object as a parameter. | ||
* It retrieves the Reader from the Response and overrides the close method to close | ||
* both the Reader and the Response object, ensuring proper resource management and preventing | ||
* premature closure of the underlying HTTP connection. | ||
*/ | ||
public class ResponseBodyReader extends FilterReader { | ||
private final Response response; | ||
|
||
/** | ||
* Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. | ||
* | ||
* @param response the OkHttp Response object from which the Reader is retrieved | ||
* @throws IOException if an I/O error occurs while retrieving the Reader | ||
*/ | ||
public ResponseBodyReader(Response response) throws IOException { | ||
super(response.body().charStream()); | ||
this.response = response; | ||
} | ||
|
||
/** | ||
* Closes the Reader and the associated OkHttp Response object. This ensures that the | ||
* underlying HTTP connection is properly closed after the reader is no longer needed. | ||
* | ||
* @throws IOException if an I/O error occurs | ||
*/ | ||
@Override | ||
public void close() throws IOException { | ||
super.close(); | ||
response.close(); // Ensure the response is closed when the reader is closed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.