diff --git a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftApiResponse.java b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftApiResponse.java index 29c4884c8..5ac97744e 100644 --- a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftApiResponse.java +++ b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftApiResponse.java @@ -34,7 +34,7 @@ * *
Example usage error handling workflow: * - *
+ **/ @AutoValue public abstract class MicrosoftApiResponse { @@ -163,9 +163,8 @@ public void throwDtpException(String message) "Microsoft destination storage limit reached", toIoException(message)); case FATAL_STATE_FATAL_UNSPECIFIED: throw toIoException(String.format("%s: %s", CAUSE_PREFIX_UNRECOGNIZED_EXCEPTION, message)); - default: - throw new AssertionError("exhaustive switch"); } + throw new AssertionError("exhaustive switch"); } /** @@ -208,6 +207,8 @@ public IOException toIoException() { } /** + * Produce {@link toIoException} with a message used to construct the exception's cause. + * * @param message The cause-message one might expect with a {@link java.lang.Exception} * construction. */ diff --git a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java index b39abbd19..fd81979e0 100644 --- a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java +++ b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/media/MicrosoftMediaImporter.java @@ -155,7 +155,6 @@ private void logDebugJobStatus(String format, UUID jobId, MediaContainerResource } /** Returns a folder ID after asking Microsoft APIs to allocate one for the given album. */ - @SuppressWarnings("unchecked") private String createOneDriveFolder(MediaAlbum album) throws IOException, CopyExceptionWithFailureReason { Map{@code * MicrosoftApiResponse resp = someServerCall(); * Optional+ * }recovery = resp.recoverableState(); * if (recovery.isPresent()) { @@ -48,7 +48,7 @@ * } * } * resp.throwDtpException(); // or returnConvertDtpException might help - *
Example usage: * - *
+ ** * @param causeMessage a contextual message to include as the root cause/context when throwing a * DTP excption. @@ -401,9 +400,8 @@ private MicrosoftApiResponse tryWithCredsOrFail(Request.Builder req, String caus String.format( "bug! microsoft server needs token refresh immediately after a refreshing: %s", causeMessage)); - default: - throw new AssertionError("exhaustive switch"); } + throw new AssertionError("exhaustive switch"); } return response.returnConvertDtpException( String.format( @@ -417,10 +415,10 @@ private MicrosoftApiResponse tryWithCredsOrFail(Request.Builder req, String caus * *{@code * MicrosoftApiResponse resp = tryWithCredsOrFail(request, "creating a folder"); * checkState(resp.isOkay(), "bug: tryWithCredsOrFail() should have returne healthy resp"); * // ...carry on as normal with business logic... - *+ * }
Example usage: * - *
+ ** * @param jsonResponseKey the top-level value to extract from the response body. * @param causeMessage a contextual message to include as the root cause/context when throwing a{@code * @Nonnull String folderId = tryWithCredsOrFail(request, "folderId", "creating a folder"); * // ...carry on as normal with business logic... - *+ * }