Skip to content

Commit ed7af78

Browse files
committed
Fix detailed error checkstyle
1 parent 5a810f0 commit ed7af78

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

example/src/main/java/io/tus/java/example/Api2DevdockTusDetailedError.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import java.util.Map;
1616

1717
public final class Api2DevdockTusDetailedError {
18+
/**
19+
* Run the API2 devdock detailed-error scenario.
20+
*
21+
* @param args Unused command-line arguments.
22+
* @throws Exception Thrown when the scenario cannot be executed.
23+
*/
1824
public static void main(String[] args) throws Exception {
1925
final JSONObject scenario = Api2DevdockScenario.loadScenario();
2026
final JSONObject result = uploadExpectingDetailedError(

src/main/java/io/tus/java/client/TusClient.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,18 @@ public HttpURLConnection terminateUpload(@NotNull URL uploadURL)
465465
return connection;
466466
}
467467

468+
/**
469+
* Opens the HTTP connection used by this client.
470+
*
471+
* <p>Subclasses may override this method to provide a custom transport for tests or specialized
472+
* environments. Implementations should return a fresh {@link HttpURLConnection} for the given
473+
* URL and must not connect it; callers configure headers, method, and hooks after this method
474+
* returns.
475+
*
476+
* @param uploadURL The request URL.
477+
* @return A new, unconnected HTTP connection.
478+
* @throws IOException Thrown if a connection cannot be opened.
479+
*/
468480
@NotNull
469481
protected HttpURLConnection openConnection(@NotNull URL uploadURL) throws IOException {
470482
if (proxy != null) {

src/main/java/io/tus/java/client/TusRequestException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* An {@link IOException} with TUS request context.
88
*/
9-
public class TusRequestException extends IOException implements TusDetailedError {
9+
public final class TusRequestException extends IOException implements TusDetailedError {
1010
private final TusRequestSnapshot snapshot;
1111

1212
TusRequestException(String message, TusRequestSnapshot snapshot, IOException cause) {

src/main/java/io/tus/java/client/TusResponseException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* A {@link ProtocolException} with TUS request and response context.
88
*/
9-
public class TusResponseException extends ProtocolException implements TusDetailedError {
9+
public final class TusResponseException extends ProtocolException implements TusDetailedError {
1010
private final String responseBody;
1111
private final int responseStatus;
1212
private final TusRequestSnapshot snapshot;

0 commit comments

Comments
 (0)