|
| 1 | +# java-ups-manifest-xml |
| 2 | + |
| 3 | +Java Library to download UPS Quantum View data like package manifest containing tracking information, etc. |
| 4 | +## Installation |
| 5 | + |
| 6 | +* git pull https://github.com/jelqui/java-ups-manifest-xml.git |
| 7 | +* cd java-ups-manifest-xml |
| 8 | +* add libraries dependencies under src/com/partshighway/ups/xml/libs/* |
| 9 | + |
| 10 | +## Dependencies |
| 11 | +* [jcabi-xml](http://www.jcabi.com/jcabi-xml) - Best XML Library for parsing documents |
| 12 | +* [jcabi-http](http://www.jcabi.com/jcabi-http) |
| 13 | +* [jcabi-matchers](http://matchers.jcabi.com) |
| 14 | +* [jcabi-immutable](http://immutable.jcabi.com/) |
| 15 | +* [jcabi-log](http://log.jcabi.com/) |
| 16 | +* [slf4j-api-1.7.25](https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.25) |
| 17 | +* [slf4j-simple](https://mvnrepository.com/artifact/org.slf4j/slf4j-simple/1.7.25) |
| 18 | +* [javax.json](https://mvnrepository.com/artifact/org.glassfish/javax.json/1.1) |
| 19 | +* [javax.json-api](https://mvnrepository.com/artifact/javax.json/javax.json-api/1.1) |
| 20 | +* [hamcrest-core](https://github.com/hamcrest/JavaHamcrest/hamcrest-core) |
| 21 | +* [hamcrest-library](https://github.com/hamcrest/JavaHamcrest/hamcrest-library) |
| 22 | + |
| 23 | + |
| 24 | +## Usage |
| 25 | +```java |
| 26 | +public class Main { |
| 27 | + |
| 28 | + public static void main(String[] args) { |
| 29 | + UPSRequest upsRequest=new UPSRequest(); |
| 30 | + upsRequest.setAccessLicenseNumber("LICENSENUMBER"); |
| 31 | + upsRequest.setUserId("UPSUSER"); |
| 32 | + upsRequest.setPassword("UPSPASSWORD"); |
| 33 | + upsRequest.setBeginDateTime("20170613000000");//starting date |
| 34 | + upsRequest.setEndDateTime("20170614235959");//ending date |
| 35 | + upsRequest.setUrl("https://onlinetools.ups.com/ups.app/xml/QVEvents");//ups access point |
| 36 | + upsRequest.setMaxUPSResponse(100); |
| 37 | + upsRequest.run(); |
| 38 | + int counter=1; |
| 39 | + for (Manifest man:upsRequest.getManifestList()) { |
| 40 | + Package pkg=man.getPackage(); |
| 41 | + System.out.println(counter+"\tPickUp Date="+man.getPickupDate()+"\tPO="+pkg.getPO("9",5)+"\tTrackingNumber="+man.getPackage().getTrackingNumber()+"\t"+man.getShipTo().getAddress().getPostalCode()); |
| 42 | + System.out.println("******************************"); |
| 43 | + counter++; |
| 44 | + |
| 45 | + } |
| 46 | + upsRequest.printResponseFiles(); |
| 47 | + upsRequest.printRequestFiles(); |
| 48 | + |
| 49 | + } |
| 50 | + |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## Contributing |
| 55 | +1. Fork it! |
| 56 | +2. Create your feature branch: `git checkout -b my-new-feature` |
| 57 | +3. Commit your changes: `git commit -am 'Add some feature'` |
| 58 | +4. Push to the branch: `git push origin my-new-feature` |
| 59 | +5. Submit a pull request :D |
| 60 | + |
| 61 | + |
| 62 | +## Credits |
| 63 | +* [jcabi](http://www.jcabi.com/) - Small Useful Java Components |
| 64 | +* [PartsHighway](https://store.partshighway.com) - Online Auto Parts Store |
| 65 | + |
| 66 | +## License |
| 67 | +[GNU GENERAL PUBLIC LICENSE](https://github.com/jelqui/java-ups-manifest-xml/blob/master/LICENSE) |
0 commit comments