@Override public void endElement(String uri, String localName, String qName) throws SAXException { String currentNode = this.elementStack.pop(); // if the node popped from the stack and the localName don't match, the xml document is improperly formatted if (!localName.equals(currentNode)) { throw new SAXException(SR.INVALID_RESPONSE_RECEIVED); } if (USAGE_NAME.equals(currentNode)) { this.stats.setUsage(Integer.parseInt(this.builder.toString())); } this.builder = new StringBuilder(); }
/** * Tests whether Share Stats can be updated and downloaded. * * @throws StorageException * @throws IOException * @throws URISyntaxException */ @Test @Category({ CloudTests.class }) public void testGetShareStats() throws StorageException, IOException, URISyntaxException { share.createIfNotExists(); ShareStats stats = share.getStats(); assertNotNull(stats); assertEquals(0, stats.getUsage()); FileTestHelper.uploadNewFile(share, 512, null); stats = share.getStats(); assertNotNull(stats); assertEquals(1, stats.getUsage()); }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { String currentNode = this.elementStack.pop(); // if the node popped from the stack and the localName don't match, the xml document is improperly formatted if (!localName.equals(currentNode)) { throw new SAXException(SR.INVALID_RESPONSE_RECEIVED); } if (USAGE_NAME.equals(currentNode)) { this.stats.setUsage(Integer.parseInt(this.builder.toString())); } this.builder = new StringBuilder(); }