@@ -0,0 +1,1546 @@
+package com.bigcommerce.api.resources;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.w3c.dom.Element;%0Aimport org.w3c.dom.NodeList;%0A%0Aimport com.bigcommerce.api.Connection;%0Aimport com.bigcommerce.api.Product;%0A%0A/**%0A * Facade for managing a Bigcommerce store Products Resource via the REST API.%0A */%0Apublic class Products implements Resource %7B%0A%09private Connection connection;%0A%0A%09/**%0A%09 * A simple constructor that accepts a store url connection.%0A%09 * %7B@link com.bigcommerce.api.auth.Credentials Credentials%7D.%0A%09 * %0A%09 * @param connection%0A%09 * %0A%09 */%0A%09public Products(Connection connection) %7B%0A%09%09this.connection = connection;%0A%09%7D%0A%0A%09/**%0A%09 * Gets the collection of products.%0A%09 */%0A%09public List%3CProduct%3E listAll() %7B%0A%09%09List%3CProduct%3E products = new ArrayList%3CProduct%3E();%0A%09%09Element xml = this.connection.get(%22/products%22).asXml();%0A%0A%09%09NodeList productTags = xml.getElementsByTagName(%22product%22);%0A%09%09for (int i = 0; i %3C productTags.getLength(); i++) %7B%0A%09%09%09Element productTag = (Element) productTags.item(i);%0A%09%09%09Product product = new Product(productTag);%0A%09%09%09products.add(product);%0A%09%09%7D%0A%0A%09%09return products;%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * Gets a product.%0A%09 * %0A%09 * @param orderId%0A%09 * @return%0A%09 */%0A%09public Product getOne(Integer productId) %7B%0A%09%09Product product = null;%0A%09%09StringBuffer path = new StringBuffer(%22/products/%22 + productId);%0A%09%09Element xml = this.connection.get(path.toString()).asXml();%0A%0A%09%09NodeList productTags = xml.getElementsByTagName(%22product%22);%0A%09%09Element productTag = (Element) productTags.item(0);%0A%09%09product = new Product(productTag);%0A%0A%09%09return product;%0A%09%7D%0A%0A%7D%0A

Create Products.java