Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sparuvu committed Jul 12, 2024
1 parent d2312d7 commit 935ab3d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import java.util.Map;
import java.util.StringJoiner;

import javax.annotation.Nonnull;
import org.apache.commons.lang3.NotImplementedException;
import org.datatransferproject.api.launcher.Monitor;
import org.datatransferproject.spi.transfer.types.CopyException;
import org.datatransferproject.spi.transfer.types.CopyExceptionWithFailureReason;
import org.datatransferproject.spi.transfer.types.DestinationMemoryFullException;
import org.datatransferproject.spi.transfer.types.DestinationNotFoundException;
Expand All @@ -51,10 +54,12 @@
* that Apple Supports.
*/
public interface AppleBaseInterface {
String sendPostRequest(@NotNull String url, @NotNull final byte[] requestData) throws IOException, CopyExceptionWithFailureReason;
default String sendPostRequest(@Nonnull String url, @Nonnull final byte[] requestData) throws IOException, CopyExceptionWithFailureReason {
throw new NotImplementedException("sendPostRequest is not implemented !! ");
}

default TokensAndUrlAuthData refreshTokens(final TokensAndUrlAuthData authData, final AppCredentials appCredentials, Monitor monitor)
throws InvalidTokenException {
throws CopyExceptionWithFailureReason {

final String refreshToken = authData.getRefreshToken();
final String refreshUrlString = authData.getTokenServerEncodedUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public MusicProtocol.ImportMusicPlaylistsResponse importPlaylistsBatch(final Str
requestBuilder.setExportService(JobMetadata.getExportService());
}

final byte[] responseBody = sendPostRequest(baseUrl + API.V1.PLAYLISTS, requestBuilder.build().toByteArray());
final byte[] responseBody = _sendPostRequest(baseUrl + API.V1.PLAYLISTS, requestBuilder.build().toByteArray());

return MusicProtocol.ImportMusicPlaylistsResponse.parseFrom(responseBody);
}
Expand Down Expand Up @@ -234,12 +234,12 @@ public MusicProtocol.ImportMusicPlaylistTracksResponse importMusicPlaylistItemsB
requestBuilder.setExportService(JobMetadata.getExportService());
}

final byte[] responseBody = sendPostRequest(baseUrl + API.V1.TRACKS, requestBuilder.build().toByteArray());
final byte[] responseBody = _sendPostRequest(baseUrl + API.V1.TRACKS, requestBuilder.build().toByteArray());

return MusicProtocol.ImportMusicPlaylistTracksResponse.parseFrom(responseBody);
}

private byte[] sendPostRequest(@Nonnull final String url, @Nonnull final byte[] requestData)
private byte[] _sendPostRequest(@Nonnull final String url, @Nonnull final byte[] requestData)
throws URISyntaxException, CopyException {
HttpRequest.Builder requestBuilder = createMusicImportRequest(new URI(url), requestData);
return makeMusicServiceRequest(requestBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.datatransferproject.datatransfer.apple.photos.photosproto.PhotosProtocol.NewPhotoAlbumRequest;
import org.datatransferproject.datatransfer.apple.photos.streaming.StreamingContentClient;
import org.datatransferproject.spi.transfer.idempotentexecutor.IdempotentImportExecutor;
import org.datatransferproject.spi.transfer.types.CopyException;
import org.datatransferproject.spi.transfer.types.CopyExceptionWithFailureReason;
import org.datatransferproject.spi.transfer.types.DestinationMemoryFullException;
import org.datatransferproject.spi.transfer.types.DestinationNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.datatransferproject.datatransfer.apple.constants.AuditKeys;
import org.datatransferproject.datatransfer.apple.constants.Headers;
import org.datatransferproject.spi.transfer.provider.SignalRequest;
import org.datatransferproject.spi.transfer.types.CopyException;
import org.datatransferproject.spi.transfer.types.CopyExceptionWithFailureReason;
import org.datatransferproject.spi.transfer.types.PermissionDeniedException;
import org.datatransferproject.spi.transfer.types.UnconfirmedUserException;
Expand All @@ -43,7 +44,7 @@
import org.jetbrains.annotations.NotNull;

/**
* An Interface to send the Transfer Signals to Apple.
* An Interface to send the Transfer Signals to Apple.
*/
public class AppleSignalInterface implements AppleBaseInterface {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.datatransferproject.api.launcher.Monitor;
import org.datatransferproject.datatransfer.apple.AppleInterfaceFactory;
import org.datatransferproject.spi.transfer.provider.SignalRequest;
import org.datatransferproject.spi.transfer.types.CopyException;
import org.datatransferproject.spi.transfer.types.CopyExceptionWithFailureReason;
import org.datatransferproject.spi.transfer.types.signals.SignalType;
import org.datatransferproject.types.common.models.DataVertical;
Expand All @@ -52,7 +53,7 @@ public class AppleSignalHandlerTest {
private final String exportingService = "exportingService";

@BeforeEach
public void setUp() throws CopyExceptionWithFailureReason, IOException {
public void setUp() throws CopyException, IOException {
jobId = UUID.randomUUID().toString();

appCredentials = mock(AppCredentials.class);
Expand Down

0 comments on commit 935ab3d

Please sign in to comment.