-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowserScreen_old.java
More file actions
815 lines (696 loc) · 23.6 KB
/
Copy pathBrowserScreen_old.java
File metadata and controls
815 lines (696 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
package com.mlhsoftware.commandline.oAuth;
import java.io.IOException;
import java.util.Vector;
import javax.microedition.io.HttpConnection;
import net.rim.device.api.browser.field.BrowserContent;
import net.rim.device.api.browser.field.BrowserContentChangedEvent;
import net.rim.device.api.browser.field.Event;
import net.rim.device.api.browser.field.ExecutingScriptEvent;
import net.rim.device.api.browser.field.RedirectEvent;
import net.rim.device.api.browser.field.RenderingApplication;
import net.rim.device.api.browser.field.RenderingException;
import net.rim.device.api.browser.field.RenderingOptions;
import net.rim.device.api.browser.field.RenderingSession;
import net.rim.device.api.browser.field.RequestedResource;
import net.rim.device.api.browser.field.SetHeaderEvent;
import net.rim.device.api.browser.field.SetHttpCookieEvent;
import net.rim.device.api.browser.field.UrlRequestedEvent;
import net.rim.device.api.io.http.HttpHeaders;
import net.rim.device.api.system.Application;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.component.Menu;
import net.rim.device.api.ui.component.Status;
import com.mlhsoftware.commandline.network.CookieManager;
import com.mlhsoftware.commandline.network.HttpConnectionFactory;
public class BrowserScreen extends oAuthScreen implements RenderingApplication
{
public static final String ACTION_SUCCESS = "success";
private RenderingSession renderingSession;
private HttpConnection currentConnection;
private CookieManager cookieManager;
private String url;
public HttpConnectionFactory factory;
private final MenuItem EXIT_MENU_ITEM = new MenuItem( "Exit", Integer.MAX_VALUE, 0 )
{
public void run()
{
fireAction( "cancelled" );
}
};
/**
* Constructor
*
* Instantiate an object.
*
* @param url
* is the URL to open.
* @param cookieManager
* is the cookie manager.
*/
public BrowserScreen( String url, HttpConnectionFactory factory, CookieManager cookieManager, String title )
{
super( title );
this.url = url;
System.out.println( "URL: " + this.url );
this.cookieManager = cookieManager;
this.factory = factory;
init();
}
/**
* Browse to the URL.
*
*/
public void browse()
{
if ( url != null )
{
requestURL( url, url );
}
}
public String getUrl()
{
return url;
}
protected void makeMenu( Menu menu, int instance )
{
menu.deleteAll(); //removes any contextual menu items (i.e. the "getLink" menu item added within the BrowserField).
menu.add( EXIT_MENU_ITEM );
}
/**
* Initialisation.
*
*/
private void init()
{
//Initialize the rendering session (BrowserField)
renderingSession = RenderingSession.getNewInstance();
setRenderingOptions();
}
/**
* Set rendering options.
*
*/
private void setRenderingOptions()
{
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true );
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_LOCATION_ENABLED, true );
//renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.WAP_MODE, true );
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_WML, true );
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT, true );
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_CSS, true );
renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.SHOW_IMAGES_IN_HTML, true );
}
/**
* Browse to the URL.
*
* @param url
* the URL to browse to.
* @param referrer
* the referrer URL.
*/
private void requestURL( String url, String referrer )
{
//Set the referrer header if it exists.
// note in some cases, the referrer header should not be included in the request and will be null.
HttpHeaders requestHeaders = null;
if ( referrer != null )
{
requestHeaders = new HttpHeaders();
requestHeaders.setProperty( "referer", referrer );
}
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread( url, requestHeaders, null, null );
thread.start();
}
/**
* Process the current connection.
*
* @param connection
* the connection to process.
* @param event
* the included event.
*/
private void processConnection( HttpConnection connection, Event event )
{
// A new request is being made - cancel previous request.
if ( currentConnection != null )
{
try
{
currentConnection.close();
}
catch ( IOException e )
{
System.out.println( "Exception in processConnection" +
".\nError Exception: " + e.toString() );
}
}
currentConnection = connection;
try
{
//Send the HTTP Request
BrowserContent browserContent = null;
browserContent = renderingSession.getBrowserContent( currentConnection, this, event );
if ( browserContent != null )
{
Field field = browserContent.getDisplayableContent();
//Process the HTTP Response
String urlHost = currentConnection.getHost();
String urlProtocol = currentConnection.getProtocol();
String urlCurrent = urlProtocol + "://" + urlHost;
for ( int i = 0; currentConnection.getHeaderFieldKey( i ) != null; i++ )
{
String headerKey = currentConnection.getHeaderFieldKey( i );
if ( headerKey.equalsIgnoreCase( "set-cookie" ) )
{
//Save cookie(s) for this set-cookie header to persistent storage container:
String cookie = currentConnection.getHeaderField( i );
cookieManager.storeCookies( cookie, urlHost );
}
else if ( headerKey.equalsIgnoreCase( "content-location" ) )
{
//Check to see if server has indicated content to be retrieved from a new location
String newLocation = currentConnection.getHeaderField( i );
if ( urlCurrent.equalsIgnoreCase( newLocation ) )
{
//ideal: no internal redirects have occurred. Continue processing the response.
}
else
{
//Even though the server returned a 200 code, this is a redirect scenario. Send request for new URL.
requestURL( newLocation, urlCurrent );
break;
}
}
}
if ( field != null )
{
synchronized ( Application.getEventLock() )
{
deleteAll();
add( field );
}
}
//BrowserContent won't render any of its associated content until the finishLoading method has been invoked:
browserContent.finishLoading();
}
}
catch ( RenderingException e )
{
System.out.println( "Exception in processConnection" + ".\nError Exception: " + e.toString() );
}
catch ( IOException e )
{
System.out.println( "Exception in processConnection" + ".\nError Exception: " + e.toString() );
}
catch ( Exception e )
{
System.out.println( "Exception in processConnection" + ".\nError Exception: " + e.toString() );
}
finally
{
SecondaryResourceFetchThread2.doneAddingImages();
}
}
/**
* @see net.rim.device.api.browser.RenderingApplication#eventOccurred(net.rim.device.api.browser.Event)
*/
public Object eventOccurred( Event event )
{
int eventId = event.getUID();
switch ( eventId )
{
case Event.EVENT_URL_REQUESTED:
{
UrlRequestedEvent urlRequestedEvent = (UrlRequestedEvent)event;
String absoluteURL = urlRequestedEvent.getURL();
urlRequestedEvent.getHeaders().removeProperties( "referer" );
PrimaryResourceFetchThread thread = new PrimaryResourceFetchThread( absoluteURL, urlRequestedEvent.getHeaders(), urlRequestedEvent.getPostData(), event );
thread.start();
break;
}
case Event.EVENT_BROWSER_CONTENT_CHANGED:
{
BrowserContentChangedEvent browserContentChangedEvent = (BrowserContentChangedEvent)event;
if ( browserContentChangedEvent.getSource() instanceof BrowserContent )
{
BrowserContent browserField = (BrowserContent)browserContentChangedEvent.getSource();
url = browserField.getURL();
Application.getApplication().invokeAndWait( new Runnable()
{
public void run()
{
fireAction( ACTION_SUCCESS );
}
} );
}
break;
}
case Event.EVENT_REDIRECT:
{
RedirectEvent redirectEvent = (RedirectEvent)event;
String referrer = redirectEvent.getSourceURL();
switch ( redirectEvent.getType() )
{
case RedirectEvent.TYPE_SINGLE_FRAME_REDIRECT:
{
// Show redirect message.
Application.getApplication().invokeAndWait( new Runnable()
{
public void run()
{
Status.show( "You are being redirected to a different page..." );
}
} );
break;
}
case RedirectEvent.TYPE_JAVASCRIPT:
{
referrer = currentConnection.getURL();
break;
}
case RedirectEvent.TYPE_META:
{
// MSIE and Mozilla don't send a Referer for META Refresh.
referrer = null;
break;
}
case RedirectEvent.TYPE_300_REDIRECT:
{
// MSIE, Mozilla, and Opera all send the original
// request's Referer as the Referer for the new request.
Object eventSource = redirectEvent.getSource();
if ( eventSource instanceof HttpConnection )
{
referrer = ( (HttpConnection)eventSource ).getRequestProperty( "referer" );
}
break;
}
}
try
{
Object eventSource = redirectEvent.getSource();
if ( eventSource instanceof HttpConnection )
{
HttpConnection redirConn = (HttpConnection)eventSource;
String host = redirConn.getHost();
String headerKey = "";
for ( int i = 0; ( headerKey = redirConn.getHeaderFieldKey( i ) ) != null; i++ )
{
if ( headerKey.equalsIgnoreCase( "set-cookie" ) )
{
String cookie = redirConn.getHeaderField( i );
cookieManager.storeCookies( cookie, host );
}
}
}
}
catch ( IOException e )
{
System.out.println( "Exception" + ".\nError Exception: " + e.toString() );
}
catch ( Exception e )
{
System.out.println( "Exception" + ".\nError Exception: " + e.toString() );
}
requestURL( redirectEvent.getLocation(), referrer );
break;
}
case Event.EVENT_CLOSE:
{
if ( currentConnection != null )
{
try
{
currentConnection.close();
}
catch ( IOException e )
{
System.out.println( "Exception" + ".\nError Exception: " + e.toString() );
}
}
cookieManager = null;
renderingSession = null;
break;
}
case Event.EVENT_SET_HEADER:
{
SetHeaderEvent setHeaderEvent = (SetHeaderEvent)event;
String value = setHeaderEvent.getValue();
break;
}
case Event.EVENT_SET_HTTP_COOKIE:
{
//"Cookie" Http header set by JavaScript - add to cookie store.
try
{
SetHttpCookieEvent setHttpCookieEvent = (SetHttpCookieEvent)event;
cookieManager.storeCookies( setHttpCookieEvent.getCookie(), currentConnection.getHost() );
}
catch ( Exception e )
{
System.out.println( "Exception" + ".\nError Exception: " + e.toString() );
}
break;
}
case Event.EVENT_EXECUTING_SCRIPT:
{
ExecutingScriptEvent executingScriptEvent = (ExecutingScriptEvent)event;
break;
}
case Event.EVENT_HISTORY: // No history support.
case Event.EVENT_FULL_WINDOW: // No full window support.
case Event.EVENT_STOP: // No stop loading support.
default:
break;
}
return null;
}
/**
* @see net.rim.device.api.browser.RenderingApplication#getAvailableHeight(net.rim.device.api.browser.BrowserContent)
*/
public int getAvailableHeight( BrowserContent browserField )
{
// Field has full screen.
return Display.getHeight(); // - titlebarMgr.getHeight();
}
/**
* @see net.rim.device.api.browser.RenderingApplication#getAvailableWidth(net.rim.device.api.browser.BrowserContent)
*/
public int getAvailableWidth( BrowserContent browserField )
{
// Field has full screen.
return Display.getWidth();
}
/**
* @see net.rim.device.api.browser.RenderingApplication#getHistoryPosition(net.rim.device.api.browser.BrowserContent)
*/
public int getHistoryPosition( BrowserContent browserField )
{
// No history support.
return 0;
}
/**
* @see net.rim.device.api.browser.RenderingApplication#getHTTPCookie(java.lang.String)
*/
public String getHTTPCookie( String url )
{
//Retrieves cookies associated with a provided URL. This method is triggered when JavaScript on a web page requests a cookie.
//The method does not send a cookie or communicate the cookie to the web server hosting the page.
String sHost = getHostFromURL( url );
return cookieManager.getCookies( sHost );
}
/**
* @see net.rim.device.api.browser.RenderingApplication#getResource(net.rim.device.api.browser.RequestedResource, net.rim.device.api.browser.BrowserContent)
*
* Purpose: Retrieve page resources such as images (asyncronously if possible) This method must return a non-null HTTP connection when the referrer is null. This call can be non-blocking if referrer is not null. If the call is not blocking, referrer must be notified with the connection via referrer.resourceReady(HttpConnection) call.
*
* Requested resource objects get passed into a rendering application when the rendering session needs assistance in rendering an off-page resource (e.g. an image)
*/
public HttpConnection getResource( RequestedResource resource, BrowserContent referrer )
{
if ( resource == null )
{
return null;
}
String url = resource.getUrl();
// Check if this is cache-only request.
if ( resource.isCacheOnly() )
{
// Incomplete: No cache support (need to check cache for resource and return that, otherwise)
// If RequestedResource.isCacheOnly() is true then the content should only be returned if it is cached.
return null;
}
if ( url == null )
{
return null;
}
//Any requests for external resources should include the same headers sent for normal web requests (e.g. cookies / user-agent).
HttpHeaders headers = setHeaders( resource.getRequestHeaders(), cookieManager.getCookies( getHostFromURL( url ) ) );
// If referrer is null we must return the connection.
if ( referrer == null )
{
try
{
return factory.getHttpConnection( url, headers );
}
catch ( Exception e )
{
System.out.println( "Exception" + ".\nError Exception: " + e.toString() );
}
}
else
{
// If referrer is provided we can set up the connection on a separate thread.
SecondaryResourceFetchThread2.enqueue( resource, referrer, headers, factory );
}
return null;
}
/**
* @see net.rim.device.api.browser.RenderingApplication#invokeRunnable(java.lang.Runnable)
*/
public void invokeRunnable( Runnable runnable )
{
( new Thread( runnable ) ).start();
}
//-----------------------------------------------------------------------------
//Organizes HTTP Headers into a single collection:
//
public HttpHeaders setHeaders( HttpHeaders existingHeaders, String sCookies )
{
HttpHeaders headers = new HttpHeaders();
//Use headers provided by calling method (e.g. "referrer"):
if ( existingHeaders != null )
{
headers.setProperties( existingHeaders );
}
// Headers to be included in all HTTP requets:
headers.setProperty( "User-Agent", HttpConnectionFactory.getUserAgent() );
headers.setProperty( "Profile", HttpConnectionFactory.getProfile() );
headers.setProperty( "x-wap-profile", HttpConnectionFactory.getProfile() );
headers.setProperty( "x-rim-transcode-content", "*/*" );
headers.setProperty( "Accept", "application/vnd.rim.html,text/html,application/xhtml+xml,application/vnd.wap.xhtml+xml,application/vnd.wap.wmlc;q=0.9,application/vnd.wap.wmlscriptc;q=0.7,text/vnd.wap.wml;q=0.7,text/vnd.sun.j2me.app-descriptor,image/vnd.rim.png,image/jpeg,application/x-vnd.rim.pme.b,application/vnd.rim.ucs,image/gif;anim=1,application/vnd.rim.css;v=1,text/css;media=screen,*/*;q=0.5" );
headers.setProperty( "x-rim-original-accept", "application/vnd.rim.html,text/html,application/xhtml+xml,application/vnd.wap.xhtml+xml,application/vnd.wap.wmlc;q=0.9,application/vnd.wap.wmlscriptc;q=0.7,text/vnd.wap.wml;q=0.7,text/vnd.sun.j2me.app-descriptor,image/vnd.rim.png,image/jpeg,application/x-vnd.rim.pme.b,application/vnd.rim.ucs,image/gif;anim=1,application/vnd.rim.css;v=1,text/css;media=screen,*/*;q=0." );
headers.setProperty( "x-rim-gw-properties", "16.10" );
headers.setProperty( "x-rim-accept-encoding", "yk;v=3;m=384" );
//Add Cookie header to HTTP Request if cookies exists
if ( !sCookies.equals( "" ) )
{
headers.setProperty( "Cookie", sCookies );
}
return headers;
}
private static String getHostFromURL( String url )
{
int end_protocol = url.indexOf( "//" );
if ( end_protocol < 0 )
{
return url;
}
String rem_protocol = url.substring( end_protocol + 2, url.length() );
int end = rem_protocol.indexOf( "/" );
String host = "";
if ( end >= 0 )
{
host = rem_protocol.substring( 0, end );
}
else
{
host = rem_protocol;
}
return host;
}
/**
* PrimaryResourceFetchThread
*
* @author Eki Baskoro
* @version 0.1
*
*/
private class PrimaryResourceFetchThread extends Thread
{
private String _url;
private HttpHeaders _requestHeaders;
private byte[] _postData;
private Event _event;
PrimaryResourceFetchThread( String url, HttpHeaders requestHeaders, byte[] postData, Event event )
{
//Retrieves cookies saved for the domain being request, and set them as HTTP headers
String sCookies = cookieManager.getCookies( getHostFromURL( url ) );
_url = url;
_requestHeaders = setHeaders( requestHeaders, sCookies );
_postData = postData;
_event = event;
}
public void run()
{
//at this point, all headers should be added to the HeadersCollection:
try
{
HttpConnection connection = factory.getHttpConnection( _url, _requestHeaders, _postData );
processConnection( connection, _event );
}
catch ( Exception e )
{
System.out.println( "Exception in PrimaryResourceFetchThread" +
".\nError Exception: " + e.toString() );
}
}
}
}
/**
* SecondaryResourceFetchThread
*
* @author Eki Baskoro
* @version 0.1
*
*/
class SecondaryResourceFetchThread2 extends Thread
{
/**
* Callback browser field.
*/
private BrowserContent browserField;
/**
* Connection headers.
*/
private HttpHeaders headers;
private HttpConnectionFactory factory;
/**
* Images to retrieve.
*/
private Vector imageQueue;
/**
* True is all images have been enqueued.
*/
private boolean done;
/**
* Sync object.
*/
private static Object syncObject = new Object();
/**
* Singleton
*/
private static SecondaryResourceFetchThread2 instance;
/**
* Enqueues secondary resource for a browser field.
*
* @param resource
* - resource to retrieve.
* @param referrer
* - call back browsr field.
*/
public static void enqueue( RequestedResource resource, BrowserContent referrer, HttpHeaders requestHeaders, HttpConnectionFactory pFactory )
{
if ( resource == null )
{
return;
}
synchronized ( syncObject )
{
// Create new thread.
if ( instance == null )
{
instance = new SecondaryResourceFetchThread2();
instance.start();
instance.headers = requestHeaders;
instance.factory = pFactory;
}
else
{
// If thread already is running, check that we are adding images for the same browser field.
if ( referrer != instance.browserField )
{
synchronized ( instance.imageQueue )
{
// If the request is for a different browser field clear old elements.
instance.imageQueue.removeAllElements();
}
}
}
synchronized ( instance.imageQueue )
{
instance.imageQueue.addElement( resource );
}
instance.browserField = referrer;
}
}
/**
* Default Constructor.
*
*/
private SecondaryResourceFetchThread2()
{
imageQueue = new Vector();
}
/**
* Indicate that all images have been enqueued for this browser field.
*
*/
static void doneAddingImages()
{
synchronized ( syncObject )
{
if ( instance != null )
{
instance.done = true;
}
}
}
public void run()
{
while ( true )
{
if ( done )
{
// Check if we are done requesting images.
synchronized ( syncObject )
{
synchronized ( imageQueue )
{
if ( imageQueue.size() == 0 )
{
instance = null;
break;
}
}
}
}
RequestedResource resource = null;
// Request next image.
synchronized ( imageQueue )
{
if ( imageQueue.size() > 0 )
{
resource = (RequestedResource)imageQueue.elementAt( 0 );
imageQueue.removeElementAt( 0 );
}
}
if ( resource != null )
{
//pass headers to secondary resource request:
if ( headers == null )
{
headers = new HttpHeaders();
}
headers.setProperties( resource.getRequestHeaders() );
try
{
HttpConnection connection = factory.getHttpConnection( resource.getUrl(), headers );
resource.setHttpConnection( connection );
}
catch ( Exception e )
{
System.out.println( "Exception in SecondaryResourceFetchThread2" +
".\nError Exception: " + e.toString() );
}
// Signal to the browser field that resource is ready.
if ( browserField != null )
{
browserField.resourceReady( resource );
}
}
}
}
}