Skip to content

Commit

Permalink
Merge pull request #7 from Gruncan/v1.1a
Browse files Browse the repository at this point in the history
V1.1a
  • Loading branch information
Gruncan authored Dec 16, 2022
2 parents 0a2c45b + 1645ef5 commit 0840211
Show file tree
Hide file tree
Showing 71 changed files with 711 additions and 2,206 deletions.
19 changes: 16 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


<groupId>com.spotstat</groupId>
<artifactId>spotstat</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>S4J</artifactId>
<version>1.1a</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand All @@ -18,12 +18,25 @@

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<excludedGroups>SlowNetworkTest</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>


</project>
5 changes: 5 additions & 0 deletions src/main/java/com/http/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public HttpResponse execute() {


int code = con.getResponseCode();
// if request failed at receiver end
if (code != 200)
return new HttpResponse(code, null, con.getResponseMessage());

// if request failed at client end
InputStream is = con.getErrorStream();
if (is == null)
is = con.getInputStream();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/spotify/SpotifyClient.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.spotify;

import com.spotify.json.JSONObject;
import com.spotify.requests.AbstractRequest;
import com.spotify.requests.IRequest;
import com.spotify.requests.RequestResponse;

public interface SpotifyClient {


// to be changed
JSONObject executeRequest(AbstractRequest abstractRequest);
RequestResponse executeRequest(IRequest request);


}
7 changes: 4 additions & 3 deletions src/main/java/com/spotify/SpotifyClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import com.http.HttpResponse;
import com.http.SpotifyHttpServerProvider;
import com.spotify.json.JSONObject;
import com.spotify.requests.AbstractRequest;
import com.spotify.requests.IRequest;
import com.spotify.requests.RequestResponse;
import com.spotify.requests.util.Scope;
import com.spotify.util.Util;

Expand Down Expand Up @@ -197,8 +198,8 @@ public SpotifyClientImp(String accessToken) {


@Override
public JSONObject executeRequest(AbstractRequest abstractRequest) {
return abstractRequest.execute(this.accessToken);
public RequestResponse executeRequest(IRequest request) {
return request.execute(this.accessToken);
}
}
}
14 changes: 0 additions & 14 deletions src/main/java/com/spotify/objects/SpotifyField.java

This file was deleted.

38 changes: 0 additions & 38 deletions src/main/java/com/spotify/objects/SpotifyImage.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/com/spotify/objects/SpotifyNotRequired.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/com/spotify/objects/SpotifyObject.java

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/com/spotify/objects/album/Album.java

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/java/com/spotify/objects/search/SearchResult.java

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/com/spotify/objects/track/AudioRecordArray.java

This file was deleted.

119 changes: 0 additions & 119 deletions src/main/java/com/spotify/objects/track/Track.java

This file was deleted.

Loading

0 comments on commit 0840211

Please sign in to comment.