Skip to content

Commit

Permalink
Filled out most of the POM requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
MouaYing committed May 27, 2016
1 parent c0719ca commit 42662de
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
35 changes: 26 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,32 @@

<groupId>com.smartystreets.api</groupId>
<artifactId>smartystreets-java-sdk</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>SmartyStreets Java SDK</name>
<description>A library for Java developers to help them easily access the SmartyStreets APIs.</description>
<url>The Github Repository</url> <!-- TODO: Put in the real Github repo URL -->

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers> <!-- TODO: Should we do it this way, or list the individuals who worked on it? -->
<developer>
<name>SmartyStreets SDK Team</name>
<email>[email protected]</email>
<organization>SmartyStreets</organization>
</developer>
</developers>

<scm> <!-- TODO: Set up the Github repo and fill this in -->
<connection></connection>
<developerConnection></developerConnection>
<url></url>
</scm>

</project>
6 changes: 3 additions & 3 deletions src/main/java/com/smartystreets/api/GoogleSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.Map;

public class GoogleSender implements Sender {
private final int BUFFER_SIZE = 16384;
private int maxTimeOut;
private HttpTransport transport;

Expand All @@ -32,7 +31,7 @@ public GoogleSender(int maxTimeout) {

public Response send(Request request) throws SmartyException, IOException {
HttpRequest httpRequest = buildHttpRequest(request);
copyHeaders(request, httpRequest);
this.copyHeaders(request, httpRequest);

try {
return buildResponse(httpRequest.execute());
Expand Down Expand Up @@ -60,7 +59,7 @@ private void copyHeaders(Request request, HttpRequest httpRequest) {
for (String headerName : headers.keySet())
httpHeaders.set(headerName, headers.get(headerName));

httpHeaders.setUserAgent("smartystreets sdk:java@" + this.VERSION);
httpHeaders.setUserAgent("smartystreets sdk:java@" + VERSION);
}

private Response buildResponse(HttpResponse httpResponse) throws IOException {
Expand All @@ -74,6 +73,7 @@ private byte[] readResponseBody(HttpResponse httpResponse) throws IOException {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

int totalBytesRead;
final int BUFFER_SIZE = 16384;
byte[] buffer = new byte[BUFFER_SIZE];

while ((totalBytesRead = inputStream.read(buffer, 0, BUFFER_SIZE)) != -1) {
Expand Down

0 comments on commit 42662de

Please sign in to comment.