commit de11a550eb8cb49541ee6f371143beb12aff3e3e Author: Thomas Schwery Date: Sat Feb 10 12:48:22 2024 +0100 feat: Import of project at 2014-03-16 diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..ede944b --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project SBBCommandLine. + + + diff --git a/lib/commons-codec-1.6.jar b/lib/commons-codec-1.6.jar new file mode 100644 index 0000000..ee1bc49 Binary files /dev/null and b/lib/commons-codec-1.6.jar differ diff --git a/lib/commons-io-2.4-javadoc.jar b/lib/commons-io-2.4-javadoc.jar new file mode 100644 index 0000000..e388f28 Binary files /dev/null and b/lib/commons-io-2.4-javadoc.jar differ diff --git a/lib/commons-io-2.4-sources.jar b/lib/commons-io-2.4-sources.jar new file mode 100644 index 0000000..f4ebc7b Binary files /dev/null and b/lib/commons-io-2.4-sources.jar differ diff --git a/lib/commons-io-2.4-test-sources.jar b/lib/commons-io-2.4-test-sources.jar new file mode 100644 index 0000000..88ce974 Binary files /dev/null and b/lib/commons-io-2.4-test-sources.jar differ diff --git a/lib/commons-io-2.4-tests.jar b/lib/commons-io-2.4-tests.jar new file mode 100644 index 0000000..bad9e82 Binary files /dev/null and b/lib/commons-io-2.4-tests.jar differ diff --git a/lib/commons-io-2.4.jar b/lib/commons-io-2.4.jar new file mode 100644 index 0000000..90035a4 Binary files /dev/null and b/lib/commons-io-2.4.jar differ diff --git a/lib/commons-logging-1.1.3.jar b/lib/commons-logging-1.1.3.jar new file mode 100644 index 0000000..ab51254 Binary files /dev/null and b/lib/commons-logging-1.1.3.jar differ diff --git a/lib/fluent-hc-4.3.1.jar b/lib/fluent-hc-4.3.1.jar new file mode 100644 index 0000000..d0e9e86 Binary files /dev/null and b/lib/fluent-hc-4.3.1.jar differ diff --git a/lib/httpclient-4.3.1.jar b/lib/httpclient-4.3.1.jar new file mode 100644 index 0000000..9b47364 Binary files /dev/null and b/lib/httpclient-4.3.1.jar differ diff --git a/lib/httpclient-cache-4.3.1.jar b/lib/httpclient-cache-4.3.1.jar new file mode 100644 index 0000000..52789a2 Binary files /dev/null and b/lib/httpclient-cache-4.3.1.jar differ diff --git a/lib/httpcore-4.3.jar b/lib/httpcore-4.3.jar new file mode 100644 index 0000000..e5da457 Binary files /dev/null and b/lib/httpcore-4.3.jar differ diff --git a/lib/httpmime-4.3.1.jar b/lib/httpmime-4.3.1.jar new file mode 100644 index 0000000..f6ee60e Binary files /dev/null and b/lib/httpmime-4.3.1.jar differ diff --git a/lib/jdom205/LICENSE.txt b/lib/jdom205/LICENSE.txt new file mode 100644 index 0000000..2474698 --- /dev/null +++ b/lib/jdom205/LICENSE.txt @@ -0,0 +1,54 @@ +/*-- + + Copyright (C) 2000-2012 Jason Hunter & Brett McLaughlin. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact . + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management . + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Jason Hunter and + Brett McLaughlin . For more information + on the JDOM Project, please see . + + */ + diff --git a/lib/jdom205/README.txt b/lib/jdom205/README.txt new file mode 100644 index 0000000..db160ab --- /dev/null +++ b/lib/jdom205/README.txt @@ -0,0 +1,119 @@ +Introduction to the JDOM project +================================ + +Please see the JDOM web site at http://jdom.org/ +and GitHub repository at https://github.com/hunterhacker/jdom/ + +Quick-Start for JDOM +===================== +See the github wiki for a Primer on using JDOM: +https://github.com/hunterhacker/jdom/wiki/JDOM2-A-Primer + +Also see the web site http://jdom.org/downloads/docs.html. It has links to +numerous articles and books covering JDOM. + + +Installing the build tools +========================== + +The JDOM build system is based on Apache Ant. Ant is a little but very +handy tool that uses a build file written in XML (build.xml) as building +instructions. For more information refer to "http://ant.apache.org". + +The only thing that you have to make sure of is that the "JAVA_HOME" +environment property is set to match the top level directory containing the +JVM you want to use. For example: + +C:\> set JAVA_HOME=C:\jdk1.6 + +or on Mac: + +% setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home + (csh) +> JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home; export JAVA_HOME + (ksh, bash) + +or on Unix: + +% setenv JAVA_HOME /usr/local/java + (csh) +> JAVA_HOME=/usr/java; export JAVA_HOME + (ksh, bash) + +That's it! + + +Building instructions +===================== + +If you do not have the full source code it can be cloned from GitHub. The JDOM +project at https://github.com/hunterhacker/jdom has the instructions and source +URL to make the git clone easy. + +You will need to have Apache Ant 1.8.2 or later, and you will need Java JDK 1.6 +or later. + +Ok, let's build the code. First, make sure your current working directory is +where the build.xml file is located. Then run "ant". + +If everything is right and all the required packages are visible, this action +will generate a file called "jdom-2.x-20yy.mm.dd.HH.MM.zip" in the +"./build/package" directory. This is the same 'zip' file that is distributed +as the official JDOM distribution. + +The name of the zip file (and the jar names inside the zip) is controlled by +the two ant properties 'name' and 'version'. The package is called +"${name}-${version}.zip". The 'official' JDOM Build process is done by +creating a file 'build.properties' in the 'top' folder of the JDOM code, and +it contains the single line (or whatever the appropriate version is): + +version=2.0.0 + +If your favourite Java IDE happens to be Eclipse, you can run the 'eclipse' ant +target, and that will configure your Eclipse project to have all the right +'source' folders, and 'Referenced Libraries'. After running the 'ant eclipse' +target, you should refresh your Eclipse project, and you should have a project +with no errors or warnings. + + +Build targets +============= + +The build system is not only responsible for compiling JDOM into a jar file, +but is also responsible for creating the HTML documentation in the form of +javadocs. + +These are the meaningful targets for this build file: + + - package [default] -> generates ./build/package/jdom*.zip + - compile -> compiles the source code + - javadoc -> generates the API documentation in ./build/javadocs + - junit -> runs the JUnit tests + - coverage -> generates test coverage metrics + - eclipse -> generates an Eclipse project (source folders, jars, etc) + - clean -> restores the distribution to its original and clean state + - maven -> generates the package, and makes a 'bundle' for maven-central + +To learn the details of what each target does, read the build.xml file. It is +quite understandable. + + +Bug Reports +=========== + +Bug reports go to the jdom-interest list at jdom.org. But *BEFORE YOU POST* +make sure you've tested against the LATEST code available from GitHub (or the +daily snapshot). Odds are good your bug has already been fixed. If it hasn't +been fixed in the latest version, then when posting *BE SURE TO SAY* which +code version you tested against. For example, "GitHub from October 3rd". Also +be sure to include enough information to reproduce the bug and full exception +stack traces. You might also want to read the FAQ at http://jdom.org to find +out if your problem is not really a bug and just a common misunderstanding +about how XML or JDOM works. + + +Searching for Information +========================= + +The JDOM mailing lists are archived and easily searched at +http://jdom.markmail.org. diff --git a/lib/jdom205/jdom-2.0.5-contrib.jar b/lib/jdom205/jdom-2.0.5-contrib.jar new file mode 100644 index 0000000..7432b75 Binary files /dev/null and b/lib/jdom205/jdom-2.0.5-contrib.jar differ diff --git a/lib/jdom205/jdom-2.0.5-javadoc.jar b/lib/jdom205/jdom-2.0.5-javadoc.jar new file mode 100644 index 0000000..79f0c19 Binary files /dev/null and b/lib/jdom205/jdom-2.0.5-javadoc.jar differ diff --git a/lib/jdom205/jdom-2.0.5-junit.jar b/lib/jdom205/jdom-2.0.5-junit.jar new file mode 100644 index 0000000..eb1ba0c Binary files /dev/null and b/lib/jdom205/jdom-2.0.5-junit.jar differ diff --git a/lib/jdom205/jdom-2.0.5-sources.jar b/lib/jdom205/jdom-2.0.5-sources.jar new file mode 100644 index 0000000..7ccbe80 Binary files /dev/null and b/lib/jdom205/jdom-2.0.5-sources.jar differ diff --git a/lib/jdom205/jdom-2.0.5.jar b/lib/jdom205/jdom-2.0.5.jar new file mode 100644 index 0000000..b6996c7 Binary files /dev/null and b/lib/jdom205/jdom-2.0.5.jar differ diff --git a/lib/jdom205/lib/jaxen-1.1.6.LICENSE.txt b/lib/jdom205/lib/jaxen-1.1.6.LICENSE.txt new file mode 100644 index 0000000..815a72b --- /dev/null +++ b/lib/jdom205/lib/jaxen-1.1.6.LICENSE.txt @@ -0,0 +1,33 @@ +/* + $Id: LICENSE.txt 1128 2006-02-05 21:49:04Z elharo $ + + Copyright 2003-2006 The Werken Company. All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the Jaxen Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ diff --git a/lib/jdom205/lib/jaxen-1.1.6.jar b/lib/jdom205/lib/jaxen-1.1.6.jar new file mode 100644 index 0000000..52f47a4 Binary files /dev/null and b/lib/jdom205/lib/jaxen-1.1.6.jar differ diff --git a/lib/jdom205/lib/xerces.2.11.LICENSE b/lib/jdom205/lib/xerces.2.11.LICENSE new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/lib/jdom205/lib/xerces.2.11.LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/jdom205/lib/xerces.2.11.NOTICE b/lib/jdom205/lib/xerces.2.11.NOTICE new file mode 100644 index 0000000..b79ac95 --- /dev/null +++ b/lib/jdom205/lib/xerces.2.11.NOTICE @@ -0,0 +1,17 @@ + ========================================================================= + == NOTICE file corresponding to section 4(d) of the Apache License, == + == Version 2.0, in this case for the Apache Xerces Java distribution. == + ========================================================================= + + Apache Xerces Java + Copyright 1999-2010 The Apache Software Foundation + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + Portions of this software were originally based on the following: + - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. + - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. + - voluntary contributions made by Paul Eng on behalf of the + Apache Software Foundation that were originally developed at iClick, Inc., + software copyright (c) 1999. \ No newline at end of file diff --git a/lib/jdom205/lib/xercesImpl.jar b/lib/jdom205/lib/xercesImpl.jar new file mode 100644 index 0000000..0aaa990 Binary files /dev/null and b/lib/jdom205/lib/xercesImpl.jar differ diff --git a/lib/jdom205/lib/xml-apis.jar b/lib/jdom205/lib/xml-apis.jar new file mode 100644 index 0000000..4673346 Binary files /dev/null and b/lib/jdom205/lib/xml-apis.jar differ diff --git a/manifest.mf b/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..69273c9 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..ee83e7b --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=10763fbf +build.xml.script.CRC32=6dfdbbcc +build.xml.stylesheet.CRC32=8064a381@1.68.1.46 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=10763fbf +nbproject/build-impl.xml.script.CRC32=44a2d1b4 +nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46 diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..d3e5026 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,6 @@ +compile.on.save=true +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=/home/valdor/.netbeans/7.4/build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..eb0c74f --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,113 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=SBBCommandLine +application.vendor=valdor +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/SBBCommandLine.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.commons-codec-1.6.jar=lib/commons-codec-1.6.jar +file.reference.commons-io-2.4-javadoc.jar=lib/commons-io-2.4-javadoc.jar +file.reference.commons-io-2.4-sources.jar=lib/commons-io-2.4-sources.jar +file.reference.commons-io-2.4-test-sources.jar=lib/commons-io-2.4-test-sources.jar +file.reference.commons-io-2.4-tests.jar=lib/commons-io-2.4-tests.jar +file.reference.commons-io-2.4.jar=lib/commons-io-2.4.jar +file.reference.commons-logging-1.1.3.jar=lib/commons-logging-1.1.3.jar +file.reference.fluent-hc-4.3.1.jar=lib/fluent-hc-4.3.1.jar +file.reference.httpclient-4.3.1.jar=lib/httpclient-4.3.1.jar +file.reference.httpclient-cache-4.3.1.jar=lib/httpclient-cache-4.3.1.jar +file.reference.httpcore-4.3.jar=lib/httpcore-4.3.jar +file.reference.httpmime-4.3.1.jar=lib/httpmime-4.3.1.jar +file.reference.jaxen-1.1.6.jar=lib/jdom205/lib/jaxen-1.1.6.jar +file.reference.jdom-2.0.5-contrib.jar=lib/jdom205/jdom-2.0.5-contrib.jar +file.reference.jdom-2.0.5-javadoc.jar=lib/jdom205/jdom-2.0.5-javadoc.jar +file.reference.jdom-2.0.5-sources.jar=lib/jdom205/jdom-2.0.5-sources.jar +file.reference.jdom-2.0.5.jar=lib/jdom205/jdom-2.0.5.jar +file.reference.xercesImpl.jar=lib/jdom205/lib/xercesImpl.jar +file.reference.xml-apis.jar=lib/jdom205/lib/xml-apis.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.commons-codec-1.6.jar}:\ + ${file.reference.commons-io-2.4-javadoc.jar}:\ + ${file.reference.commons-io-2.4-sources.jar}:\ + ${file.reference.commons-io-2.4-test-sources.jar}:\ + ${file.reference.commons-io-2.4-tests.jar}:\ + ${file.reference.commons-io-2.4.jar}:\ + ${file.reference.commons-logging-1.1.3.jar}:\ + ${file.reference.fluent-hc-4.3.1.jar}:\ + ${file.reference.httpclient-4.3.1.jar}:\ + ${file.reference.httpclient-cache-4.3.1.jar}:\ + ${file.reference.httpcore-4.3.jar}:\ + ${file.reference.httpmime-4.3.1.jar}:\ + ${file.reference.jaxen-1.1.6.jar}:\ + ${file.reference.jdom-2.0.5-contrib.jar}:\ + ${file.reference.jdom-2.0.5-javadoc.jar}:\ + ${file.reference.jdom-2.0.5-sources.jar}:\ + ${file.reference.jdom-2.0.5.jar}:\ + ${file.reference.xercesImpl.jar}:\ + ${file.reference.xml-apis.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=sbbcommandline.SBBCommandLine +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..3e41fd0 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + SBBCommandLine + + + + + + + + + diff --git a/src/sbbcommandline/SBBCommandLine.java b/src/sbbcommandline/SBBCommandLine.java new file mode 100644 index 0000000..2794778 --- /dev/null +++ b/src/sbbcommandline/SBBCommandLine.java @@ -0,0 +1,214 @@ +package sbbcommandline; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.StringReader; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.zip.GZIPInputStream; +import org.apache.commons.io.FileUtils; +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.BasicHttpEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.jdom2.Content; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.JDOMException; +import org.jdom2.input.SAXBuilder; +import sbbcommandline.objects.SBBStation; + +public class SBBCommandLine { + + private final static String BASE_URL = "http://xmlfahrplan.sbb.ch/bin/extxml.exe/"; + private final static String USER_AGENT = "SBBMobile/%1$s (Android/%2$s %3$s; SDK/%4$s; fr)"; + + private final static String STATION_QUERY = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + + private final static String CONNECTION_QUERY = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + + public static void main(String[] args) throws IOException, JDOMException { + + SBBStation startStation = getStation("Icogne poste"); + SBBStation endStation = getStation("Lausanne jordils"); + + getConnections(startStation, endStation, new Date()); + } + + private static SBBStation getStation(String stationName) throws IOException, JDOMException { + String request = String.format(STATION_QUERY, stationName); + + Element rootElement = getResponse(request); + Element stationListElement = rootElement.getChild("LocValRes"); + + Element stationElement = stationListElement.getChild("Station"); + + SBBStation startStation = new SBBStation(stationName); + startStation.fillFromXML(stationElement); + + return startStation; + + } + + private static Element getResponse(String requestXML) throws IOException, JDOMException { + byte[] requestBytes = requestXML.getBytes(); + String response = new SBBCommandLine().testDL(requestBytes); + + System.out.println("Got response " + response); + + Document doc = new SAXBuilder().build(new StringReader(response)); + + //ConRes is the root element of the response. + Element rootElement = doc.getRootElement(); + + return rootElement; + } + + private static void getConnections(SBBStation start, SBBStation end, Date departure) throws IOException, JDOMException { + + String date = new SimpleDateFormat("yyyyMMdd").format(departure); + String time = new SimpleDateFormat("HH:mm").format(departure); + + String request = String.format(CONNECTION_QUERY, start.getName(), start.getExternalId(), end.getName(), end.getExternalId(), date, time); + + System.out.println("Request is " + request); + //if (request != null) return; + + Element rootElement = getResponse(request); + + Element conResElement = rootElement.getChild("ConRes"); + + if (conResElement.getChild("Err") != null) { + // We encountered an error, print it out and abort, no more info is included + // in the response. + + Element errorElem = conResElement.getChild("Err"); + System.out.println("Got error code (" + errorElem.getAttributeValue("code") + "): " + errorElem.getAttributeValue("text")); + return; + } + + //ConResCtxt is a "Cookie" that has to be sent if we want to "scroll". + Element conResCtxtElement = conResElement.getChild("ConResCtxt"); + + // ConnectionList contains the list of connections + Element connectionListElement = conResElement.getChild("ConnectionList"); + for (Element elem : connectionListElement.getChildren()) { + dumpConnection(elem); + } + } + + private static void dumpConnection(Element connectionElement) { + Element overviewElement = connectionElement.getChild("Overview"); + Element conSectionListElement = connectionElement.getChild("ConSectionList"); + + String time = overviewElement.getChild("Departure").getChild("BasicStop").getChild("Dep").getChild("Time").getValue(); + String station = overviewElement.getChild("Departure").getChild("BasicStop").getChild("Station").getAttributeValue("name"); + + System.out.println(); + System.out.println(); + System.out.println("Departure from " + station + " at " + time); + + for (Element elem : conSectionListElement.getChildren()) { + + Element departureElement = elem.getChild("Departure"); + Element arrivalElement = elem.getChild("Arrival"); + + String depName = departureElement.getChild("BasicStop").getChild("Station").getAttributeValue("name"); + String arrName = arrivalElement.getChild("BasicStop").getChild("Station").getAttributeValue("name"); + System.out.println("From " + depName + " to " + arrName); + } + + } + + + private static String getUserAgent() { + String str = USER_AGENT; + Object[] arrayOfObject = new Object[4]; + arrayOfObject[0] = "2.3.2"; + arrayOfObject[1] = "4.1.2"; + arrayOfObject[2] = "Fusion Cookie"; + arrayOfObject[3] = "12"; + return String.format(str, arrayOfObject); + } + + private String testDL(byte[] paramArrayOfByte) throws IOException { + DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient(); + HttpPost localHttpPost = new HttpPost(BASE_URL); + BasicHttpEntity localBasicHttpEntity = new BasicHttpEntity(); + localBasicHttpEntity.setContentType("application/xml"); + ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(paramArrayOfByte); + localBasicHttpEntity.setContent(localByteArrayInputStream); + localBasicHttpEntity.setContentLength(paramArrayOfByte.length); + localHttpPost.setEntity(localBasicHttpEntity); + + localHttpPost.setHeader("User-Agent", getUserAgent()); + + localHttpPost.setHeader("Accept", "application/xml"); + + localHttpPost.setHeader("Accept-Language", "FR"); + + localHttpPost.getParams().setBooleanParameter("http.protocol.expect-continue", false); + localHttpPost.setHeader("Accept-Encoding", "gzip"); + + String str1 = null; // No cookies ... + if (str1 != null) { + localHttpPost.setHeader("Cookie", "AL_LB=" + str1); + } + + // No redirect ? + //localDefaultHttpClient.setRedirectHandler(EnvironmentUtil.getRedirectHandler()); + HttpResponse localHttpResponse = localDefaultHttpClient.execute(localHttpPost); + int i = localHttpResponse.getStatusLine().getStatusCode(); + + InputStream content = localHttpResponse.getEntity().getContent(); + HttpEntity localHttpEntity = localHttpResponse.getEntity(); + + //System.out.println("Got response status " + i + " of size " + localBasicHttpEntity.getContentLength() + " bytes."); + + byte[] arrayOfByte = new byte[1024]; + InputStream is; + if ((localHttpEntity.getContentEncoding() != null) && ("gzip".equals(localHttpEntity.getContentEncoding().getValue()))) { + is = new GZIPInputStream(localHttpResponse.getEntity().getContent()); + } else { + is = new BufferedInputStream(localHttpResponse.getEntity().getContent()); + } + + OutputStream baos = new ByteArrayOutputStream(); + while (true) { + int k = is.read(arrayOfByte, 0, 1024); + if (k == -1) { + break; + } + baos.write(arrayOfByte, 0, k); + } + + return ((ByteArrayOutputStream) baos).toString(); + + } + +} diff --git a/src/sbbcommandline/objects/SBBStation.java b/src/sbbcommandline/objects/SBBStation.java new file mode 100644 index 0000000..267b8c7 --- /dev/null +++ b/src/sbbcommandline/objects/SBBStation.java @@ -0,0 +1,50 @@ +package sbbcommandline.objects; + +import org.jdom2.Element; + +public class SBBStation { + + /** Name of the station */ + private String name; + + /** Identifier of the station in the HAFAS system */ + private String externalId; + + /** UNKNOWN */ + private String externalStationNr; + + /** Always WGS84 */ + private String type; + + /** GPS Coordinates */ + private int x; + + /** GPS Coordinates */ + private int y; + + private final static String ELEMENT_NAME = "Station"; + + public SBBStation(String name) { + this.name = name; + } + + public void fillFromXML(Element elem) { + if (!elem.getName().equals(ELEMENT_NAME)) throw new IllegalArgumentException("XML Element must be " + ELEMENT_NAME); + + this.name = elem.getAttributeValue("name"); + this.externalId = elem.getAttributeValue("externalId"); + this.externalStationNr = elem.getAttributeValue("externalStationNr"); + this.type = elem.getAttributeValue("type"); + this.x = Integer.parseInt(elem.getAttributeValue("x")); + this.y = Integer.parseInt(elem.getAttributeValue("y")); + } + + public String getName() { + return name; + } + + public String getExternalId() { + return externalId; + } + +}