<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-370297091356710504</id><updated>2011-11-30T19:29:41.486Z</updated><category term='linux'/><category term='Network'/><category term='LAF'/><category term='App'/><category term='HTC'/><category term='Metadata'/><category term='blogger'/><category term='Axis'/><category term='Hidden'/><category term='Nimbus'/><category term='JDK 7'/><category term='ows_MetaInfo'/><category term='SharePoint'/><category term='fonts'/><category term='named parameters'/><category term='JavaFX linux'/><category term='wsdl'/><category term='invalid XML characters'/><category term='Android'/><category term='SSID'/><category term='border'/><category term='opera'/><title type='text'>A Mug Of Java</title><subtitle type='html'>My thoughts, code snippets and musings on Java and technology in general...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-8151314920739392547</id><published>2011-11-30T15:35:00.006Z</published><updated>2011-11-30T19:29:41.495Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='App'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='HTC'/><title type='text'>Silent Start</title><content type='html'>I love my little HTC Android handset, but one thing that does bug me, despite HTC's moniker of "Quietly Brilliant" is that every time you turn the handset on it plays a loud and annoying startup sound which cannot be disabled. So, to combat this I have put together a small Android App which silences this noisy start.&lt;br /&gt;&lt;br /&gt;The app is fairly simple. It switches the ringer and media volumes to silent when you shut the handset down, and restores them again when you switch the handset back on and bootup has completed.&lt;br /&gt;&lt;br /&gt;If you wish to install the app you can find the apk file &lt;a href="http://www.bensblog.talktalk.net/SilentStart-release.apk"&gt;here&lt;/a&gt;. In order to install it you will need to ensure that you have "Unknown sources" option enabled which you will find in Settings -&amp;gt; Applications.&lt;br /&gt;&lt;br /&gt;I have only tested it on my own HTC Wildfire S so any feedback from other device users would be greatly appreciated.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note &lt;/b&gt;: Doesn't currently seem to work correctly with Fast Boot enabled.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-8151314920739392547?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/8151314920739392547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2011/11/silent-start.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8151314920739392547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8151314920739392547'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2011/11/silent-start.html' title='Silent Start'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-4010330443262074960</id><published>2011-09-23T12:33:00.002+01:00</published><updated>2011-09-23T13:26:03.859+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='border'/><title type='text'>Remove Blogger Image Borders</title><content type='html'>By default, Blogger places a shadowed border around all images. Now, you may like the border and you may not. If not, keep reading as I will explain how to remove the border from all images.&lt;br /&gt;&lt;br /&gt;You will need to make some changes to the template of your blog. There are a few steps involved, but it's a fairly simple process:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Click on the design option and then select Template Designer.&lt;/li&gt;&lt;li&gt;From the design screen click the Advanced option.&lt;/li&gt;&lt;li&gt;Scroll to the bottom of the advanced options and select 'Add CSS' (see fig below).&lt;/li&gt;&lt;li&gt;Cut and paste the following into the custom CSS pane:&lt;/li&gt;&lt;/ol&gt;&lt;div style="margin-left: 20px; margin-right: auto;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;.post-body img {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; &amp;nbsp; border: 0px;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; &amp;nbsp; -moz-box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; &amp;nbsp; -webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; &amp;nbsp; box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;The CSS should have an immediate effect and you should find that your images loose the border. If you are happy, click the 'Apply to Blog' button and your changes will be saved.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-NVEaF2xmxN4/TnxuAEtNCaI/AAAAAAAAADw/5FGIxj_u3Ps/s1600/blogger_mods.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="310" src="http://2.bp.blogspot.com/-NVEaF2xmxN4/TnxuAEtNCaI/AAAAAAAAADw/5FGIxj_u3Ps/s400/blogger_mods.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Adding custom CSS&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-4010330443262074960?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/4010330443262074960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2011/09/remove-blogger-image-borders.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/4010330443262074960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/4010330443262074960'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2011/09/remove-blogger-image-borders.html' title='Remove Blogger Image Borders'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-NVEaF2xmxN4/TnxuAEtNCaI/AAAAAAAAADw/5FGIxj_u3Ps/s72-c/blogger_mods.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-4101062374414177333</id><published>2011-06-27T10:57:00.000+01:00</published><updated>2011-06-27T10:57:21.026+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSID'/><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Hidden'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android - Adding A Hidden Network</title><content type='html'>I like to keep my router locked down and so I keep my SSID hidden. This has never been a problem, until that is, I bought myself an Android smartphone. Although it was possible to connect to my hidden network by adding it manually and entering the password details when prompted, it only seemed to connect the first time. Subsequent connections would always fail. In the end, after some Googling (other search engines are available) I managed to resolve the problem:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;From your home screen hit the menu button and select settings.&lt;/li&gt;&lt;li&gt;Select Wireless &amp;amp; Networks&lt;/li&gt;&lt;li&gt;Select Wi-Fi settings&lt;/li&gt;&lt;li&gt;Select Add Wi-Fi network&lt;/li&gt;&lt;li&gt;Enter the SSID for the hidden network. DO NOT CLICK SAVE.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-p_Y7RARGMy8/TghRIWo5EUI/AAAAAAAAADk/JasO8H5Omk0/s1600/device_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-p_Y7RARGMy8/TghRIWo5EUI/AAAAAAAAADk/JasO8H5Omk0/s320/device_1.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;As you can just see from the screen shot the form is in fact scrollable and contains more than just the Network SSID value. Scroll the form to reveal the security type list box.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Select the security used for your network.&lt;/li&gt;&lt;li&gt;Scroll the form further to reveal the password box and enter the password.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;table border="0" style="text-align: center; margin-left: auto; margin-right: auto;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-C4wWNrjA4HQ/TghRLVHVytI/AAAAAAAAADo/qeMdN-AEoRo/s1600/device_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-C4wWNrjA4HQ/TghRLVHVytI/AAAAAAAAADo/qeMdN-AEoRo/s320/device_2.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-WfiVeRrcIyM/TghROU-bQUI/AAAAAAAAADs/85hNnQmY3lI/s1600/device_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-WfiVeRrcIyM/TghROU-bQUI/AAAAAAAAADs/85hNnQmY3lI/s320/device_3.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;Click Save and it after a few seconds it should connect! And that should be it. You should find that it will now connect every time. Happy Surfing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-4101062374414177333?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/4101062374414177333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2011/06/android-adding-hidden-network.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/4101062374414177333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/4101062374414177333'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2011/06/android-adding-hidden-network.html' title='Android - Adding A Hidden Network'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-p_Y7RARGMy8/TghRIWo5EUI/AAAAAAAAADk/JasO8H5Omk0/s72-c/device_1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-8325049029767854994</id><published>2010-12-13T12:04:00.003Z</published><updated>2010-12-14T10:44:22.258Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Ugly Opera Fonts Under Linux - How To Fix It</title><content type='html'>The latest incarnation of the Opera Browser, version 11 is currently in Beta (at time of writing) and so far I have been really impressed with it. I may finally have found an alternative to the excellent, but increasingly sluggish FireFox. However, despite it's speed, overall elegant looks and ease of use the first thing I noticed upon installing it was how ugly most of the fonts looked (something that had previously been fine in earlier 10 releases) and no matter how much tweaking I made to my .fonts.conf file I couldn't improve things. I then discovered that during the 10.x cycle Opera switched from using .fonts.conf to xrdb. Adding the following into the .Xdefaults file in my home directory and re-starting X solved the problem and now the fonts look great again :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;Xft.antialias: 1&lt;br /&gt;Xft.autohint: 1&lt;br /&gt;Xft.hinting: 1&lt;br /&gt;Xft.hintstyle: hintslight&lt;br /&gt;Xft.rgba: none&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you find after doing the above the fonts still look ugly, it may be that .Xdefaults on your system is not being read or honored. So, add &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;xrdb -override .Xdefaults&lt;/span&gt; to your .bashrc script and try again! As you can see from the screen shots below - the fonts look much better after the config change.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_3Ge27BBQC8E/TQYKxlZ1_4I/AAAAAAAAAC0/uSBREf9L5iI/s1600/opera_before.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="248" src="http://3.bp.blogspot.com/_3Ge27BBQC8E/TQYKxlZ1_4I/AAAAAAAAAC0/uSBREf9L5iI/s320/opera_before.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_3Ge27BBQC8E/TQYK3TbKxXI/AAAAAAAAAC4/2gzoXdTHMkQ/s1600/opera_after.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="248" src="http://4.bp.blogspot.com/_3Ge27BBQC8E/TQYK3TbKxXI/AAAAAAAAAC4/2gzoXdTHMkQ/s320/opera_after.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-8325049029767854994?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/8325049029767854994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2010/12/making-operas-fonts-look-good-again.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8325049029767854994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8325049029767854994'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2010/12/making-operas-fonts-look-good-again.html' title='Ugly Opera Fonts Under Linux - How To Fix It'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_3Ge27BBQC8E/TQYKxlZ1_4I/AAAAAAAAAC0/uSBREf9L5iI/s72-c/opera_before.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-217687262787300519</id><published>2010-11-12T11:25:00.000Z</published><updated>2010-11-12T11:25:48.772Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nimbus'/><category scheme='http://www.blogger.com/atom/ns#' term='LAF'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 7'/><title type='text'>Bye, bye Metal</title><content type='html'>My IDE of choice is &lt;a href="http://www.netbeans.org/"&gt;NetBeans&lt;/a&gt; and my development platform, &lt;a href="http://www.mandriva.org/"&gt;Mandriva&lt;/a&gt; Linux with a KDE desktop. During my time as a Java developer I have always run NetBeans (and Java Desktop applications in general) using the default Metal look and feel having found the GTK laf unusable on my KDE desktop; the fonts, tabs and menus look awful. So, when I learnt about a new look and feel called Nimbus that was to be introduced with JDK 6 u10 I was eager to try it out. However, my enthusiasm soon turned to disappointment when I discovered similar rendering problems I had found with the GTK laf, so, back to Metal I went.... Until a few days ago when, with my system on the latest updates of JDK 6 and NetBeans I decided to try it again. This time I was pleasantly surprised - it looked fabulous! The fonts, tabs, menu - all rendering perfectly. All of a sudden NetBeans looked less flat and more polished.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://picasaweb.google.com/lh/photo/Qt-5ea7RpGwB-ajrUogs4b9QrK8WtYNeRJAyWz6HW7o?feat=directlink"&gt;&lt;img border="0" height="247" src="http://2.bp.blogspot.com/_3Ge27BBQC8E/TN0h5cpWpPI/AAAAAAAAABc/M0rX_nyyHDE/s320/nb7.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;It was a shame to read in a recent post that &lt;a href="http://blogs.oracle.com/henrik/2010/11/nimbus_look-and-feel_in_jdk_7.html"&gt;Oracle&lt;/a&gt; has decided to keep Metal as the default laf for JDK 7 rather than switching to Nimbus. But for me, I think I will be making a permanent switch to Nimbus. Bye, Bye metal. You did a good job but now it's time to go...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-217687262787300519?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/217687262787300519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2010/11/bye-bye-metal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/217687262787300519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/217687262787300519'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2010/11/bye-bye-metal.html' title='Bye, bye Metal'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3Ge27BBQC8E/TN0h5cpWpPI/AAAAAAAAABc/M0rX_nyyHDE/s72-c/nb7.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-7746135216620672788</id><published>2010-02-17T10:38:00.007Z</published><updated>2010-02-17T11:04:34.256Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='ows_MetaInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='Metadata'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Parsing SharePoint Metadata</title><content type='html'>&lt;p&gt;The SharePoint Document libraries hold a lot of metadata against each document which is returned in the web services in the ows_MetaInfo field. This is a long string of metadata which, in the GetListItemChanges method is broken up into lines making it easy to pick out each key and value pair. However, the GetListItem methods returns this metadata as a plain string leaving it up to you to parse and turn in to something meaningful. After much head scratching and memory refreshing on regular expressions I have come up with a snippet of code that, for all my testing so far, successfully pulls out each key and value pair :&lt;/p&gt;&lt;p&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Pattern pattern = Pattern.compile("(\\w*):\\w{2}\\|");&lt;br /&gt;  Matcher matcher = pattern.matcher(ows_MetaInfo);&lt;br /&gt;&lt;br /&gt;  boolean fnd = matcher.find();&lt;br /&gt;&lt;br /&gt;  while (fnd)&lt;br /&gt;  {&lt;br /&gt;    String key = matcher.group(1).trim();&lt;br /&gt;&lt;br /&gt;    int start = matcher.end();&lt;br /&gt;&lt;br /&gt;    fnd = matcher.find();&lt;br /&gt;&lt;br /&gt;    int end = fnd ? matcher.start() -1 : ows_MetaInfo.length();&lt;br /&gt;&lt;br /&gt;    String val = ows_MetaInfo.substring(start, end);&lt;br /&gt;&lt;br /&gt;    if (val.length() &gt; 0) &lt;br /&gt;     {&lt;br /&gt;          System.out.println("Key: " + key + " - Val: " + val);&lt;br /&gt;     } &lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-7746135216620672788?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/7746135216620672788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2010/02/parsing-sharepoint-metadata.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/7746135216620672788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/7746135216620672788'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2010/02/parsing-sharepoint-metadata.html' title='Parsing SharePoint Metadata'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-432670417888259611</id><published>2009-06-02T13:18:00.003+01:00</published><updated>2009-06-02T13:20:20.080+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaFX linux'/><title type='text'>JavaFX On Linux</title><content type='html'>After what seems like a long wait, JavaFX v1.2 is available for Linux. You can get it from the main JavaFX Site &lt;a href="http://www.javafx.com"&gt;here&lt;/a&gt;. At the time of writing the link still showed v1.1 of the SDK, but click it and you will see that it is in fact 1.2&lt;br /&gt;&lt;br /&gt;I shall post my musings when I get time to try it out.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-432670417888259611?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/432670417888259611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2009/06/javafx-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/432670417888259611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/432670417888259611'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2009/06/javafx-on-linux.html' title='JavaFX On Linux'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-2075318027372167171</id><published>2009-05-08T14:18:00.018+01:00</published><updated>2009-05-08T14:51:37.640+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Axis'/><category scheme='http://www.blogger.com/atom/ns#' term='named parameters'/><category scheme='http://www.blogger.com/atom/ns#' term='wsdl'/><title type='text'>Axis Named Parameters</title><content type='html'>Axis makes creating web services fairly straight forward, but I came across something a little unexpected recently when programming a new web service. I was writing a very straight forward web service to return an address for a given name and post code. The initial WSDL looked like this (note this is only a snippet to show the relevant part):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://myweb.tiscali.co.uk/bensblog/blogsource/axisparams/axis_before_small.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 416px; height: 136px;" src="http://myweb.tiscali.co.uk/bensblog/blogsource/axisparams/axis_before_small.jpg" alt="" border="0" /&gt;&lt;/a&gt;As you can see, the service takes three parameters; firstName, lastName and postCode. Once I had completed and finished debugging the web service I deployed it. However, after the final deployment, I noticed that the WSDL had changed:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://myweb.tiscali.co.uk/bensblog/blogsource/axisparams/axis_after_small.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 416px; height: 136px;" src="http://myweb.tiscali.co.uk/bensblog/blogsource/axisparams/axis_after_small.jpg" alt="" border="0" /&gt;&lt;/a&gt;As you can see, the parameters are no longer named and have been replaced with generic names of in0, in1 and in2. So why did the parameter names change all of a sudden?&lt;br /&gt;&lt;br /&gt;After a bit of head scratching and searching I figured it out. Whilst developing the web service I had been compiling the Java code with debugging enabled (-g flag), but once I had finished and was deploying the final version I switched off debugging. Axis uses the debugging symbols in the bytecode to determine the parameter names. Without this, it reverts to the generic parameter names.&lt;br /&gt;&lt;br /&gt;I think from now on I will just leave debugging enabled!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-2075318027372167171?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/2075318027372167171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2009/05/axis-named-parameters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/2075318027372167171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/2075318027372167171'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2009/05/axis-named-parameters.html' title='Axis Named Parameters'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-370297091356710504.post-8827515958315827011</id><published>2008-11-21T17:21:00.002Z</published><updated>2009-01-05T06:54:30.016Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Axis'/><category scheme='http://www.blogger.com/atom/ns#' term='invalid XML characters'/><title type='text'>Invalid XML Characters</title><content type='html'>Consuming third party web services is usually a very straight forward task, and most of the time they work without a problem. However, every now and again one comes along that is quite happy to return data containing invalid XML characters and causes Axis to throw an exception and cease processing in complete disgust. The ideal solution is to get the third party to fix their web service but sometimes this is not possible. I had once such problem the other week when consuming a web service provided by Microsoft SharePoint. It was not possible to alter the web service or fix the underlying data that was causing the problem so I had to deal with the problem client end. To do this I took advantage of Axis' custom handlers. With handlers you can insert code into the Axis chain and obtain a handle to the input stream allowing you to alter the contents before passing it back into the chain where processing continues as normal.&lt;br /&gt;&lt;br /&gt;The easiest way to create a new handler is to extend &lt;span style="font-family:courier new;"&gt;BasicHandler&lt;/span&gt; and implement the invoke method. The following example does just that and removes all &lt;span style="font-family:courier new;"&gt;&amp;#nnn;&lt;/span&gt; entities from the XML.&lt;br /&gt;&lt;pre style="font-family: courier new; font-size: 80%;"&gt;&lt;br /&gt;package org.bensjavaspot.handlers;&lt;br /&gt;&lt;br /&gt;import java.io.ByteArrayInputStream;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.regex.Matcher;&lt;br /&gt;import java.util.regex.Pattern;&lt;br /&gt;import javax.xml.soap.SOAPException;&lt;br /&gt;import javax.xml.transform.stream.StreamSource;&lt;br /&gt;import org.apache.axis.AxisFault;&lt;br /&gt;import org.apache.axis.Message;&lt;br /&gt;import org.apache.axis.MessageContext;&lt;br /&gt;import org.apache.axis.handlers.BasicHandler;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.apache.axis.SOAPPart;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Custom Axis handler that allows us to intercept the incoming input stream and&lt;br /&gt;* remove any bad characters before passing it back into the chain.&lt;br /&gt;*&lt;br /&gt;* @author Ben Hills&lt;br /&gt;*/&lt;br /&gt;public class SOAPCleanerHandler extends BasicHandler&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  private static final Log log = LogFactory.getLog(SOAPCleanerHandler.class);&lt;br /&gt;&lt;br /&gt;  public void invoke(MessageContext mtx) throws AxisFault {&lt;br /&gt;&lt;br /&gt;     /* Get the SOAP Message */&lt;br /&gt;     Message message = mtx.getResponseMessage();&lt;br /&gt;&lt;br /&gt;     if (message != null) {&lt;br /&gt;        try {&lt;br /&gt;           /* Message normally consists of single part and optionally attachments. We just need the main part */&lt;br /&gt;           SOAPPart part = (org.apache.axis.SOAPPart) message.getSOAPPart();&lt;br /&gt;&lt;br /&gt;           /* Get the source */&lt;br /&gt;           StreamSource source = (StreamSource) part.getContent();&lt;br /&gt;&lt;br /&gt;           /* Get the input XML as a string */&lt;br /&gt;           String messageAsString = message.getSOAPPartAsString();&lt;br /&gt;&lt;br /&gt;           /* Regexp utils need a StringBuffer so create new one with input string */&lt;br /&gt;           StringBuffer out = new StringBuffer(messageAsString);&lt;br /&gt;&lt;br /&gt;           /* Create regular expresion to remove all &amp;#nnn; type entities */&lt;br /&gt;           Pattern pat = Pattern.compile("&amp;amp;#[0-9]*;");&lt;br /&gt;&lt;br /&gt;           Matcher matcher = pat.matcher(out.toString());&lt;br /&gt;           StringBuffer sb = new StringBuffer();&lt;br /&gt;&lt;br /&gt;           /* Replace each match found with a single space */&lt;br /&gt;           while (matcher.find()) {&lt;br /&gt;              matcher.appendReplacement(sb, " ");&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           matcher.appendTail(sb);&lt;br /&gt;&lt;br /&gt;           /* Convert back to byte array using the correct encoding */&lt;br /&gt;           ByteArrayInputStream b = new ByteArrayInputStream(sb.toString().getBytes(part.getEncoding()));&lt;br /&gt;&lt;br /&gt;           /* Pass input stream back in to chain */&lt;br /&gt;           source.setInputStream(b);&lt;br /&gt;&lt;br /&gt;           /* Set it again */&lt;br /&gt;           part.setContent(source);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;        catch (SOAPException ex) {&lt;br /&gt;           log.error("Failed to get and set source", ex);&lt;br /&gt;        }&lt;br /&gt;        catch (IOException ex) {&lt;br /&gt;           log.error("Error reading input stream", ex);&lt;br /&gt;        }&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can download the source code &lt;a href="http://myweb.tiscali.co.uk/bensblog/blogsource/handlers/SOAPCleanerHandler.java"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once we have created our handler we need to instruct Axis to insert it into the response chain. This is achieved by adding an entry into the Axis client-config.wsdd file&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: courier new; font-size: 80%;"&gt;&amp;lt;globalConfiguration &amp;gt;&lt;br /&gt;&amp;lt;responseFlow &amp;gt;&lt;br /&gt;&amp;lt;handler type="java:org.bensjavaspot.handlers" /&amp;gt;&lt;br /&gt;&amp;lt;/responseFlow &amp;gt;&lt;br /&gt;&amp;lt;/globalConfiguration &amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/370297091356710504-8827515958315827011?l=www.amugofjava.me.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.amugofjava.me.uk/feeds/8827515958315827011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.amugofjava.me.uk/2008/11/invalid-xml-characters.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8827515958315827011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/370297091356710504/posts/default/8827515958315827011'/><link rel='alternate' type='text/html' href='http://www.amugofjava.me.uk/2008/11/invalid-xml-characters.html' title='Invalid XML Characters'/><author><name>Ben</name><uri>http://www.blogger.com/profile/01934203047025116341</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-R2Vy-Ys0vPE/ToAwGfmq9pI/AAAAAAAAAD4/Ua7sllAJAUE/s220/android.png'/></author><thr:total>2</thr:total></entry></feed>
