import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
public static byte[] getFileBytes(File f)
{
- return /** @j2sNative f && f._bytes || */
+ // TODO temporary doubling of 秘bytes and _bytes;
+ // just remove _bytes when new transpiler has been installed
+ return /** @j2sNative f && (f.秘bytes || f._bytes) || */
null;
}
}
@SuppressWarnings("unused")
byte[] bytes = getFileAsBytes(urlstring);
+ // TODO temporary doubling of 秘bytes and _bytes;
+ // just remove _bytes when new transpiler has been installed
/**
- * @j2sNative f._bytes = bytes;
+ * @j2sNative f.秘bytes = f._bytes = bytes;
*/
return true;
}
* @param url
* @return true if window has been opened
*/
- public static boolean openURL(String url)
+ public static boolean openURL(String url) throws IOException
{
if (!isJS())
{
+ BrowserLauncher.openURL(url);
return false;
}
/**
@SuppressWarnings("unused")
ThreadGroup g = Thread.currentThread().getThreadGroup();
/**
- * @j2sNative return g.html5Applet._uniqueId;
+ * @j2sNative return g.秘html5Applet._uniqueId;
*
*/
return null;
String id = getUniqueAppletID();
String key = "", value = "";
/**
- * @j2sNative var info = g.html5Applet.__Info || {}; for (var key in info) {
- * if (key.indexOf(prefix) == 0) { value = "" + info[key];
+ * @j2sNative var info = g.秘html5Applet.__Info || {}; for (var key in info)
+ * { if (key.indexOf(prefix) == 0) { value = "" + info[key];
*/
System.out.println(
"Platform id=" + id + " reading Info." + key + " = " + value);
- p.put(id + "_" + key, value);
+ p.put(key, value);
/**
* @j2sNative
}
+ public static URL getDocumentBase()
+ {
+ try
+ {
+ return (isJS() ? new URL(/**
+ * @j2sNative J2S.thisApplet._applet.appletViewer.appletDocumentBase
+ * ||
+ */
+ "") : null);
+ } catch (MalformedURLException e)
+ {
+ return null;
+ }
+ }
+
+ public static URL getCodeBase()
+ {
+ try
+ {
+ return (isJS() ? new URL(/**
+ * @j2sNative J2S.thisApplet._applet.appletViewer.appletCodeBase
+ * ||
+ */
+ "") : null);
+ } catch (MalformedURLException e)
+ {
+ return null;
+ }
+ }
+
}