Greetings,
This is a Java implementation of the OPeNDAP DAP2 Protocol.
In this file you will find:
Also included are:
We hope we hope you find this software useful, and we welcome your questions and comments.
To contact us, please email technical support: support@opendap.org
Java 2 Standard Edition (J2SE)
Minimum: Java 1.5
Recommended: Java 1.6.x
This software was developed and tested against the 1.6.0 release of the J2SE
The core software depends on several third part libraries. All of these are included with the distribution (in the lib directory). These (should) be the ones that the code was compiled against for development and testing purposes.
It is possibly (in fact likely) that newer versions of these libraries are available from the various development teams that create these products. Replace them at your own risk.
Installation should be quite simple, just make sure that the dap2-x.x.x.jar file, along with the additional library jar files are your CLASSPATH in order for the DAP2 software to work.
Sanity Check In order to verify that you have the software and JVM sorted try the following in a shell(command line):
java -cp dap2-1.0.0.jar:lib/apache-mime4j-0.6.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1.jar:lib/commons-logging-1.1.jar:lib/jdom-1.0.jar:lib/xercesImpl-2.9.0.jar:lib/xml-apis-2.9.0.jar opendap.util.geturl.Geturl -d http://test.opendap.org:8080/opendap/data/nc/fnoc1.nc
src/opendap/dap/DConnect2.java
code as the best practice example. The simple main() method looks like this:
public static void main(String[] args) {
DConnect2 dc;
for (String url : args) {
try {
System.out.println("");
System.out.println("");
System.out.println("########################################################");
System.out.println("\nConnecting to " + url + "\n");
// Make a new DConnect2 object for the dataset URL/file.
dc = new DConnect2(url);
System.out.println("\n- - - - - - - - - - - - - - - - - - -");
System.out.println("Retrieving DDS:\n");
DDS dds = dc.getDDS();
dds.print(System.out);
System.out.println("\n- - - - - - - - - - - - - - - - - - -");
System.out.println("Retrieving DAS:\n");
DAS das = dc.getDAS();
das.print(System.out);
System.out.println("\n- - - - - - - - - - - - - - - - - - -");
System.out.println("Retrieving DDX:\n");
dds = dc.getDDX();
dds.printXML(System.out);
System.out.println("\n- - - - - - - - - - - - - - - - - - -");
System.out.println("Retrieving DATA:\n");
dds = dc.getData("");
dds.printVal(System.out, "");
System.out.println("\n- - - - - - - - - - - - - - - - - - -");
System.out.println("Writing DATA:\n");
FileOutputStream fos = new FileOutputStream("dc2.out");
DataOutputStream dos = new DataOutputStream(fos);
dds.externalize(dos);
} catch (Throwable t) {
t.printStackTrace(System.err);
}
}
}
The src/opendap/util/geturl/Geturl.java
example utilizes the older (and less useful) opendap.dap.DConnect
class.