Skip to content

Commit 625ef79

Browse files
committed
Fixed POM errors and removed references to Assets
1 parent 4e7bf2c commit 625ef79

File tree

3 files changed

+11
-55
lines changed

3 files changed

+11
-55
lines changed

pom.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@
110110
<url>file://${project.build.directory}/mvn-repo</url>
111111
</repository>
112112
</distributionManagement>
113-
<properties>
114-
<!-- github server corresponds to entry in ~/.m2/settings.xml -->
115-
<github.global.server>github</github.global.server>
116-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
117-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
118-
<java.version>1.8</java.version>
119-
</properties>
120113
<build>
121114
<finalName>Xero-Java-SDK</finalName>
122115
<plugins>
@@ -257,7 +250,11 @@
257250
</plugins>
258251
</reporting>
259252
<properties>
260-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
253+
<!-- github server corresponds to entry in ~/.m2/settings.xml -->
254+
<github.global.server>github</github.global.server>
255+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
256+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
257+
<java.version>1.8</java.version>
261258
<swagger-annotations-version>1.5.17</swagger-annotations-version>
262259
<google-api-client-version>1.23.0</google-api-client-version>
263260
<jersey-common-version>2.25.1</jersey-common-version>

src/main/java/com/xero/api/XeroClient.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.xero.api.exception.XeroExceptionHandler;
55
import com.xero.api.jaxb.XeroJAXBMarshaller;
66
import com.xero.model.*;
7-
import com.xero.models.assets.*;
87

98
import javax.xml.bind.JAXBElement;
109

@@ -1921,41 +1920,4 @@ public ByteArrayInputStream getAttachmentContentById(String endpoint, String gui
19211920
return getInputStream(endpoint + "/" + guid + "/Attachments/" + attachmentid, null, null, accept);
19221921
}
19231922

1924-
//Assets
1925-
public Assets getAssets() throws XeroApiException, ParseException {
1926-
1927-
try {
1928-
Map<String, String> params = new HashMap<String, String>();
1929-
1930-
params.put("Status","REGISTERED");
1931-
String resource = "https://api.xero.com/assets.xro/1.0/Assets";
1932-
String response = this.get2(resource, null, params);
1933-
1934-
TypeReference<Assets> typeRef = new TypeReference<Assets>() {};
1935-
ApiClient apiClient = new ApiClient();
1936-
1937-
return apiClient.getObjectMapper().readValue(response, typeRef);
1938-
1939-
} catch (IOException e) {
1940-
throw xeroExceptionHandler.convertException(e);
1941-
}
1942-
}
1943-
1944-
protected String get2(String resource, Date modifiedAfter, Map<String, String> params) throws IOException {
1945-
1946-
OAuthRequestResource req = new OAuthRequestResource(config, signerFactory, resource, "GET", null, params,"application/json");
1947-
req.setToken(token);
1948-
req.setTokenSecret(tokenSecret);
1949-
if (modifiedAfter != null) {
1950-
req.setIfModifiedSince(modifiedAfter);
1951-
}
1952-
1953-
try {
1954-
Map<String, String> resp = req.execute();
1955-
Object r = resp.get("content");
1956-
return r.toString();
1957-
} catch (IOException ioe) {
1958-
throw xeroExceptionHandler.convertException(ioe);
1959-
}
1960-
}
19611923
}

src/main/java/com/xero/example/RequestResourceServlet.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
import com.xero.api.OAuthRequestResource;
3434
import com.xero.api.XeroApiException;
3535
import com.xero.model.*;
36-
import com.xero.models.assets.*;
37-
import com.xero.models.assets.BookDepreciationSetting.AveragingMethodEnum;
38-
import com.xero.models.assets.BookDepreciationSetting.DepreciationCalculationMethodEnum;
39-
import com.xero.models.assets.BookDepreciationSetting.DepreciationMethodEnum;
4036
import com.xero.models.feedconnections.*;
4137
import com.xero.models.feedconnections.FeedConnection.AccountTypeEnum;
4238

@@ -216,13 +212,14 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
216212
}
217213

218214
} else if(object.equals("Assets")) {
219-
215+
/* Asset */
216+
/*
220217
ApiClient apiClient = new ApiClient(config.getAssetsUrl(),null,null,null);
221218
AssetApi assetApi = new AssetApi(apiClient);
222219
assetApi.setOAuthToken(token, tokenSecret);
223220
224-
/* Asset */
225-
/*
221+
222+
226223
try {
227224
Asset asset = new Asset();
228225
asset.setAssetName("Computer" + SampleData.loadRandomNum());
@@ -274,15 +271,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
274271
} catch (Exception e) {
275272
System.out.println(e.toString());
276273
}
277-
*/
274+
278275
try {
279276
Map<String, String> filter = new HashMap<>();
280277
Setting setting = assetApi.getAssetSettings(filter);
281278
messages.add("Asset Setting Start date: " + setting.getAssetStartDate());
282279
} catch (Exception e) {
283280
System.out.println(e.toString());
284281
}
285-
282+
*/
286283

287284
} else if(object.equals("Accounts")) {
288285

0 commit comments

Comments
 (0)