-package javajs.util;\r
-\r
-import java.io.IOException;\r
-import java.net.URL;\r
-import java.net.URLConnection;\r
-import java.net.URLStreamHandler;\r
-\r
-\r
-\r
-/**\r
- * \r
- * A method to allow a JavaScript AJAX adapter to \r
- * deliver web content to JSmol. This handler is just a formality.\r
- * \r
- */\r
-public class AjaxURLStreamHandler extends URLStreamHandler {\r
-\r
- String protocol;\r
-\r
- public AjaxURLStreamHandler(String protocol) {\r
- this.protocol = protocol;\r
- }\r
-\r
- @Override\r
- protected URLConnection openConnection(URL url) throws IOException {\r
- return new AjaxURLConnection(url);\r
- }\r
-\r
-\r
- @Override\r
- protected String toExternalForm(URL u) {\r
- SB result = new SB();\r
- result.append(u.getProtocol());\r
- result.append(":");\r
- if (u.getAuthority() != null && u.getAuthority().length() > 0) {\r
- result.append("//");\r
- result.append(u.getAuthority());\r
- }\r
- if (u.getPath() != null) {\r
- result.append(u.getPath());\r
- }\r
- if (u.getQuery() != null) {\r
- result.append("?");\r
- result.append(u.getQuery());\r
- }\r
- if (u.getRef() != null) {\r
- result.append("#");\r
- result.append(u.getRef());\r
- }\r
- return result.toString();\r
- }\r
-\r
-}\r
+package javajs.util;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+
+
+/**
+ *
+ * A method to allow a JavaScript AJAX adapter to
+ * deliver web content to JSmol. This handler is just a formality.
+ *
+ */
+public class AjaxURLStreamHandler extends URLStreamHandler {
+
+ String protocol;
+
+ public AjaxURLStreamHandler(String protocol) {
+ this.protocol = protocol;
+ }
+
+ @Override
+ protected URLConnection openConnection(URL url) throws IOException {
+ return new AjaxURLConnection(url);
+ }
+
+
+ @Override
+ protected String toExternalForm(URL u) {
+ SB result = new SB();
+ result.append(u.getProtocol());
+ result.append(":");
+ if (u.getAuthority() != null && u.getAuthority().length() > 0) {
+ result.append("//");
+ result.append(u.getAuthority());
+ }
+ if (u.getPath() != null) {
+ result.append(u.getPath());
+ }
+ if (u.getQuery() != null) {
+ result.append("?");
+ result.append(u.getQuery());
+ }
+ if (u.getRef() != null) {
+ result.append("#");
+ result.append(u.getRef());
+ }
+ return result.toString();
+ }
+
+}