tag:blogger.com,1999:blog-25254621805667288202024-03-13T09:38:18.966+05:30Sachin's Tech PlaceThis is basically an all-in-one repository for techie developer-related things I've experienced / come-across and from where I can easily look-up later.
From small useful tidbits, code / key shortcuts, tips, to articles /guides on how to do certain complicated tasks, all the way to full mini-programs for daily use.
If it helps anyone else out too great!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.comBlogger36125tag:blogger.com,1999:blog-2525462180566728820.post-38769598376846963972014-04-22T09:14:00.003+05:302014-04-22T09:19:08.473+05:30Using ADB to install apk files (sideload) onto a Nook HD<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial,Helvetica,sans-serif;">A typical android device allows you to install any android setup file (apk). </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">But my Nook HD has a restriction imposed by Barnes and Nobles that prevents me from installing an apk files. The only way they want you to install files is from Google Play.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">So below are instructions for installing Android applications from apk files on the Nook HD. </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">You will need to a usb cable to connect the Nook HD to your PC.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">IMPORTANT: BELOW WAS VERIFIED ON WINDOWS 7.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">ALSO VERIFIED that it DOES NOT WORK ON WINDOWS XP FOR ME (23:06 19/12/2013)</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">1) From your PC, ONETIME Download ADB + FastBoot + Drivers from http://four-nineteen.com/veronica/XDA%20Developers/Nook%20Tablet/DRIVERs/ADB%20+%20Fastboot%20+%20Drivers.zip and extract to a subdirectory..</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">2) In your Nook HD settings (goto Settings->All Settings->Device Information->Developer Options), make sure "Enabled ADB" is checked". </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">3) Make sure your Nook HD is not plugged in to your PC. </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">4) In your PC, double click on runmefirst.bat from extracted files.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">5) The new command window will warn you again to ensure your HD is not connected to your computer.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">Press any key to accept.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">Then it should say you already have an ID or USB ID has been setup. And it will ask you to install your Nook Drivers. THis can be done as follows (ONETIME STEP):</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> a) Plug in your device and open device manager.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> b) If drivers arent installed, your device will shows as a failed state with a name like BNTV400 or BNTV600 (WARNING - even if it shows up in Device Manager under "Portable Devices" as MyNook but nothing appears under "Android Phone", that means you have not enabled ADB on your Nook. FOllow instructions in Step 2).</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> c) Double click on your device to open its properties and select Update Driver.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> d) In windows 7, choose Browse my computer for driver software. THen choose Have Disk or again choose Let me pick from a list of devices. Then choose Have Disk.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> e) Browse and select the android_winusb.inf in usbdrivers directory.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> f) select ok and choose Android Composite ADB Interface. Select ok again to confirm and if prompted that it has not been signed, click ignore.</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"> g) FInally, your device should show up in Device Manager under Android Phone as Android Composite ADB Interface (it should also appear under "Portable Devices" as MyNook)!</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">6) Now open a command prompt window and navigate to the current folder where adb is available. (in administrator mode).</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">7) In the command prompt window, enter "adb install yourfile.apk" (replace yourfile.apk with the full path of your apk file).</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">8) After the "successfully installed" message, reboot your Nook by entering "adb reboot".</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;">9) After the Nook has loaded again, enter "adb kill-server" (to stop adb server). Disconnect your Nook from computer.</span></div>
Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com13tag:blogger.com,1999:blog-2525462180566728820.post-31549329719438799612011-12-01T19:38:00.004+05:302011-12-01T20:18:16.274+05:30Solution for View Source menu opening Desktop<span style="font-weight: bold;">Problem</span><br /><br />Out IT team had do downgrade Internet Explorer on one of the system from IE8 to IE6.<br /><br />Strange things began to happen after that. One frustrating issue was with clicking on the View -> Source menu in Internet Explorer 6. Instead of opening the page source in notepad, it was opening a new explorer view and showing the Desktop!!!<br /><br />Googling didn't help - there were plenty of people with the same problem but no solution.<br /><br />Thankfully, I knew it was a registry corruption issue and was able to identify the fix indirectly from some sites.<br /><br /><span style="font-weight: bold;">Actual Fix</span><br /><ol><li>Open regedit.</li><li>Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer.</li><li>Here, there should be a key called "View Source". Simply delete this key (if you feel unsafe, you can backup just this key before deletion).</li><li>Restart your internet explorer and the problem is solved!</li></ol><br /><span style="font-weight: bold;">Actual Cause</span><br />In HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer, IE 7 and 8 has a key called "View Source". This contents of this key is used to define which Editor will open when you select View Source from the menu. Unfortunately, when IE 7 or IE 8 gets rolled back to IE6, the contents of the "View Source" key is deleted from registry but not the key itself.<br />So when IE6 starts, it finds the key and incorrectly expects the editor settings there.<br />Deleting the "View Source" registry key causes IE to use notepad.exe to display the source by default!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com1tag:blogger.com,1999:blog-2525462180566728820.post-88402691333640973062010-11-20T23:41:00.004+05:302010-11-21T00:39:45.769+05:30Google Sky Map ReviewI finally found the ultimate app out there for Android - no surprise its from Google!<br />You just point the phone at the sky and it shows you the names of the heavenly objects on screen!!! Stars, planets, constellations, galaxies even! Also, in case you cant find it, you can type the name, eg: moon, and voila, it guides you to which part of the sky that object currently is.<br /><br />And there is a new feature called time travel, whereby you can view the sky forward or backward in time - so u can see historic eclipses or plan your future ones.<br /><br />Another nice thing is that, though it uses GPS to automatically find your current position, in case your GPS is slow, or you dont have GPS, or you simply want the sky details of another point on the planet, you have an option to directly enter the coordinates (latitude and longitude - which you can find out from wikimapia). Combine this with the cool Time Travel feature, and you can plan when to take your girlfriend to the beach so u wont miss the sunset next week for super brownie points ;)!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com1tag:blogger.com,1999:blog-2525462180566728820.post-82758536328105735962010-11-11T23:23:00.016+05:302010-11-21T00:40:50.886+05:30Favourite must-have Android Offline Apps<i>work in progress!</i><br />In this must have list, I will be focusing on apps that do their work without net connectivity.<br /><b>Utils</b><br /><u>Swype <a href="">apk</a></u>: This is basically an alternative to the basic keyboard Input in Android. Swype greatly reduces ur typing speed by allowing u to drag ur finger over the letters of a keyboard instead of typing each letter one by one. It then guesses smartly the correct word or gives you options if more than 1 word is eligible! On some Android phones, this comes default installed, but on others you have to install it. Make sure you dont install this if you already have it installed. You wont get this on Market but you can install it from the apk link I've given.<br /><u>Flashlight by Devesh Parekh <a href="http://www.freewarelovers.com/android/app/flashlight-by-devesh-parekh">apk</a></u>: One touch app that turns your phone into a white full bright screen. Very useful especially if you usually keep your phone on lowest light and you one day find yourself needing some light in the dark...<br /><u>Advanced Task Killer<a href="">apk</a></u>: EXCELLENT APP. Using this to kill unnecessary apps that run in the background, I was able to extend my Android battery by 6-8 hours (I can get max 48 hours with mild usage and no 3G).<br /><u>App Monster <a href="http://www.freewarelovers.com/hotlinkmenot/temp/0a5a12/1284429899_AppMonster_0.7.2.apk">apk</a></u>: A good application manager - shows u all user apps that are installed, gives you an option to back up the apps onto your sd card (useful if you installed the app via Market and dont have apk file to install later once you uninstalled).<br /><u>Cardiometer <a href="http://www.freewarelovers.com/hotlinkmenot/temp/c4c8e4/1267097308_CardioTrainer_2.1.0.apk">apk</a></u>: Inspires you to start losing weight with all its cool features!!! Shows you your calories burnt, distance travelled, even running route on a map if GPS is enabled and so much more...<br /><u>J2ME Runner <a href="http://netmite.com">Home</a></u>: Run almost any Mobile Java application on your android with this.<br /><u>Vignette <a href="http://download782.mediafire.com/i7q30ykrgy7g/wua1v21p3lk8w0b/Vignette_v2010-07-16.apk">apk</a></u>: A great replacement for the default Android Camera<br /><u>Chomp SMS <a href="http://www.freewarelovers.com/hotlinkmenot/temp/e16e51/1288963296_chompSMS_5.1.apk">apk</a></u>: Alternative to the default Android SMS app. Has a slightly better threaded view and customizable colors.<br /><br /><b>Fun</b><br /><u>Google Sky Map <a href="http://www.google.com/mobile/skymap/">Home</a></u>: THE BEST APP EVER! Detailed review at my other post <a href="http://devsac.blogspot.com/2010/11/google-sky-map-review.html">here</a>.<br /><br /><b>Games</b><br /><u>Angry Birds <a href="http://download.getjar.com/downloads/web/ppd-102-d873v111s6yi300-7449848bcab1ab115cc691a422e1a23b/107604/AngryBirds_1.3.5.apk">apk</a></u>: Amazing addictive game<br /><u>Abduction <a href="http://www.freewarelovers.com/hotlinkmenot/temp/ad4b74/1282826180_Abduction_1.47.apk">apk</a></u>: First bestseller on Android - a fun motion sensor game<br /><u>Fish food <a href="http://www.freewarelovers.com/hotlinkmenot/temp/3d911e/1270839302_FishFood1.04.apk">apk</a></u>: Interesting game with a new take on the old matching colours game.<br /><br />For offline installation and best places to download apk files, check my previous post, <a href="http://devsac.blogspot.com/2010/10/apps-for-android.html#links">Applications for Android - Online vs Offline Installation</a>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com1tag:blogger.com,1999:blog-2525462180566728820.post-66565196393903568752010-11-08T13:26:00.008+05:302011-04-30T21:19:29.650+05:30Offline installation of Anrdoid SDK (Platforms and addons)I installed Android SDK the other day to explore the apps platform for 2.1 (now that I have an Android phone!)…<br /><br />Things you need:<br /><br />A. SDK Starter package which just needs to be unzipped into a location (no installation as such):<br /><table border="1"><tbody><tr><td>Platform</td><td>Package</td><td>Size</td><td>MD5 Checksum</td></tr><tr><td>Windows</td><td>android-sdk_r07-windows.zip</td><td>23669664 bytes</td><td>69c40c2d2e408b623156934f9ae574f0</td></tr><tr><td>Mac OS X (intel)</td><td>android-sdk_r07-mac_x86.zip</td><td>19229546 bytes</td><td>0f330ed3ebb36786faf6dc72b8acf819</td></tr><tr><td>Linux (i386)</td><td>android-sdk_r07-linux_x86.tgz</td><td>17114517 bytes</td><td>e10c75da3d1aa147ddd4a5c58bfc3646</td></tr></tbody></table><br /><br />B. Platform package which is one or more of the various android versions for which you will be coding. Eg: 2.2, 2.1, 1.6, 1.5, etc.<br /><br />This has to be selected and downloaded from within the Android SDK.<br /><br /><br />But Google was forcing me to download the platform package only through the SDK. Why can’t I have a set of zips I can reuse on my laptop, desltop1, desktop2 as needed instead of having to download the Android platform repeatedly from the net for each machine?<br /><br /><br />The answer was simple after a little investigation but apparently undocumented. See below steps for full offline installation:<br /><br />1) First you need to download repository.xml file. To find out the download link for this file, launch Android AVD Manager (after unzipping the sdk, manually from %AndroidSDKDir%\tools\Android.bat or from the Eclipse plugin). Here, when you select available Packages, you will see the default target: http://dl.google.com/android/repository/repository.xml (maybe slightly different for you). Download this respository.xml file from the net (and close the AVD manager).<br /><br />2) Open the repository.xml file and search for <sdk:platform>. You will see around 5 entries for each Android platform/version.<br /><br />Identify the version you want and look for the platform filename inside the <sdk:url> tag. In my case, I wanted the 2.1 platform:<br /><pre>…<br /><sdk:platform><br /> <sdk:version>2.1</sdk:version><br /> <sdk:api-level>7</sdk:api-level><br /> <sdk:codename/><br /> <sdk:revision>02</sdk:revision><br /> <sdk:min-tools-rev>6</sdk:min-tools-rev><br /> <sdk:description>Android SDK Platform 2.1_r2</sdk:description><br /> <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url><br /> <sdk:archives><br /> <sdk:archive os="linux" arch="any"><br /> <sdk:size>72356359</sdk:size><br /> <sdk:checksum type="sha1">a89d32ddf9d8629f15e682bdf220a88ca2392349</sdk:checksum><br /> <sdk:url>android-2.1_r02-linux.zip</sdk:url><br /> </sdk:archive><br /> <sdk:archive os="macosx" arch="any"><br /> <sdk:size>71054909</sdk:size><br /> <sdk:checksum type="sha1">8492e2f0b61819c4ca2e16601fc3260b341a3f06</sdk:checksum><br /> <sdk:url>android-2.1_r02-macosx.zip</sdk:url><br /> </sdk:archive><br /> <sdk:archive os="windows" arch="any"><br /> <sdk:size>72950641</sdk:size><br /> <sdk:checksum type="sha1">00cfb0bbbf24fc56c493990186deb0bfd44630e5</sdk:checksum><br /> <sdk:url>android-2.1_r02-windows.zip</sdk:url><br /> </sdk:archive><br /> </sdk:archives><br /> </sdk:platform><br />…<br /></pre><br /><br />3) In the url obtained from step 1 (http://dl.google.com/android/repository/repository.xml), replace repository.xml with the identified filename to get the actual url of the platform file. So in this example, the url would be: http://dl.google.com/android/repository/android-2.1_r02-windows.zip<br /><br />Download this file (by typing into your browser url for eg).<br /><br />4) Once the file is downloaded, extract this file into the <Androidsdk>\platforms directory. So you would end up with a new directory here as %AndroidSDKDir%\platforms\android-2.1_r02-windows.<br /><br />That’s it!<br /><br />If you now open the AVD manager again and click on Installed Packages, the extracted platform will show up as “SDK Platform Android a.b-update c, API d, revision e”<br /><br /><br />Use similar steps to download any Addons like Google APIs, but extract the Add-ons into %AndroidSDKDir%\add-ons directory. Just make sure that before you install the Addons, you have the corresponding platform already unzipped into the platforms directory.<br /><br /><br />To summarise, now I don’t need a net connection when to install the full android SDK – I just have to keep the following files handy:<br /><br />· android-sdk_r07-windows.zip (unzip into a location where you want to install Android SDK, %AndroidSDKDir%)<br /><br />· android-2.1_r02-windows.zip (unzip into %AndroidSDKDir%\platforms)<br /><br />· google_apis-7_r01.zip (unzip into %AndroidSDKDir%\add-ons)<br /><br />· ADT-0.9.9.zip (optional but useful Eclipse plugin – see <a href="http://developer.android.com/sdk/eclipse-adt.html#troubleshooting">here</a> how to install this offline into Eclipse)<br /><br /><br /><br />Happy droiding!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com13tag:blogger.com,1999:blog-2525462180566728820.post-33580914748207063982010-10-31T00:48:00.023+05:302010-11-12T22:26:07.265+05:30Applications for Android - Online vs Offline InstallationHere's a first hand report of everything you need to know about applications for your Android 2.1 - basically a newbies perspective!<br /><br />I am going to skip a complete background of Android as it is already perfectly written over <a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29">here</a> at Wikipedia.<br /><br />Applications like on any other platform can be Paid or free. But the great thing is Android has the highest paid to free ratio for any OS (mobile or PC) of 65%!!!<br /><br />Ok. Whether free or paid, to get a new app on the phone, step no 1 is finding the apps.<br />Android Market is the official Google source with 150,000 apps and you typically find the majority listed here. Apps are also hosted on other places as listed <a href="http://en.wikipedia.org/wiki/List_of_digital_distribution_platforms_for_mobile_devices">here</a> but I have not checked them out yet - I like to get my reviews for Android Apps from <a href="http://www.appbrain.com">http://www.appbrain.com</a>.<br /><br /><br />Once you've found your App, there are 2 ways to install them on your Android phone:<br />1) Online, i.e., directly from your Android phone by browsing Android Market. This is the best way especially if you have a cheap/affordable GPRS/3G plan on your Android phone. You can just open the MarketPlace app, browse through or search, and select to install (if its not free, you have to purchase the app first of course). Your selected app will be downloaded and installed in 1 step! You never actually have to run an exe or script or anything else to install the app.<br /><br />2) Offline: If your mobile's data plan is expensive (like mine), then the only real option is to download the apps onto your PC using your affordable net connections. <br />For the Android OS, installation files ends with an .apk extension. Once you've downloaded the apk file your selected app, copy the apk file to your Android Phone (via wifi/usb/memorycard). Then simply use the File Browser app (present on all Android OS by default), select the apk file you copied and open it - you would then be prompted to install. Its not that complicated right?<br />Unfortunately, you'll find that there are very few applications being distributed officially via apk. I don't know why - especially because its not that complicated to extract an apk once you have installed it directly from Android Market.<br />There are some sites where popular apks are posted but you have to be cautious as it is not official (meaning it might be a tampered app or a completely different app you find after u install it - but this hasn't happened to me yet with the 25 and counting apps I installed):<br /><a href="http://getandroidstuff.com">http://getandroidstuff.com</a><br /><a href="http://www.freewarelovers.com/android">http://www.freewarelovers.com/android</a><br /><a href="http://www.getjar.com">http://www.getjar.com</a><br /><br /><br />One major thorny issue I want to mention about Apps on your Android before you go downloading all those free apps. Android OS has a severe flaw that forces all apps to be installed only in the phones Memory and not in the Memory Card!!! Unbelievable but true!!!!! WHY DIDN'T ANYONE TELL ME THIS BEFORE I GOT AN ANDROID <B>DUMB</B> PHONE? What a major setback for a someone rooting for Android from the word go?<br />What this means is that although my Motorola Quench HT3 supports upto 32GB Memory card, I am stuck with installing only upto 100MB of apps supported on the Internal memory storage limit on my particular phone THANKS TO GOOGLE ##@@^%$%@@!!!!!!!!!!!!!!!!!!<br />This issue is <B>finally</B> being <i>touched upon</i> in the latest Android 2.2 where app developers can give the option to the user to choose where to install the apps. Unfortunately, the default is still the phone memory. And unless older apps are updated and reinstalled, it will continue to be in the phone memory. I guess I just have to finally accept that Google is becoming another money-hungry monopoly like Yahoo and Microsoft...<br />For me with my Android 2.1 Eclair, I have no choice but to limit my applications installations but I have not yet hit the limit mind you. But that's because I was being extra careful by keeping only apps that I use regularly. Currently, there are 20 apps I have installed on my Android.<br /><br />For top must have apps for Android, check my other post, <A href="http://devsac.blogspot.com/2010/11/favourite-must-have-android-apps.html">Favourite must-have Android Apps</a>.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com3tag:blogger.com,1999:blog-2525462180566728820.post-48351216293045436072010-10-26T15:43:00.041+05:302010-11-12T00:18:24.980+05:30Motorola Quench XT3 XT502 - Day 1 ReviewFinally got myself an entry level Android phone yesterday - the Motorola Quench XT3 XT502. So here's a series of quick reviews on it from an Owners point of view.<br /><br />It's still not available for display in most shops but I was able to check it out the Tata Croma store at Vashi Centre Mall. They received their first HTC Quench XT3 just that morning but they agreed to let me switch it on and have a look even though it was in a brand new sealed-pack.<br /><br />I was pleasantly surprised to find that unlike what is advertised on Motorola's own <a href="http://www.motorola.com/Consumers/XP-EN/Consumer-Products-and-Services/Mobile-Phones/ci.MOTOROLA-QUENCH-with-MOTOBLUR-XP-EN.alt">site</a>, this phone came pre-installed with Android 2.1 instead of 1.6! I decided to get it right away for Rs 13691 (this includes the additional Rs700 I paid to Croma to get 2 additional years of warranty).<br />Also, I was able to bargain for a free 2GB Memory card.<br /><br /><b>Summary of Quench XT3 XT502</b><br /><u>Pros</u><br />HVGA screen with 2.2 inch<br />Has lots of extra hardware buttons (volume +/-, camera, Dial, Cancel Call, trackball)<br /><u>Cons</u><br />No FM<br />No Data cable<br />Only 262k colors<br />Compared to other phones, slightly lower capacity battery<br /><br /><br /><b>Whats in the box?</b><br />It came with charger, battery, earphones. That's it.<br />It does not have any memory card or even data cable. Its very strange that it did not come with memory card as most of the android features including camera need SD card! But as mentioned before, after insisting on a memory card, the Croma store people gave a Sandisk 2GB microSD free.<br />What's worse is that the lack of data cable means it will be very frustrating for those with expensive GPRS plans and no wifi - they cannot share the internet connection being used on their PC.<br />The phone has only default android apps with not even a single game. The good news there are EXCELLENT free apps available. Will cover this in a later article.<br /><br /><b>Comparison with other competing phones</b><br />When I was shopping, the only real phones I could compare in this range were<br />Samsung Galaxy I5801 (also known as )<br />Song Ericsson Xperia X8<br />Wildfire<br />LG Optimus One seems to be taking forever to reach any shops here, so I couldn't consider it.<br /><br />The screen size is important because most of 1000s of coolest (mostly free) Android apps out there work on the HVGA dimension of 320 x 480 pixels. There is a chance that if your Android phone has a different dimension, apps may run incorrectly if not at all. So this was my biggest priority.<br />Out of the available phones, no other phone provides HVGA and with 2.2 inch at this price range:<br />I5801: Only WQVGA although it has 2.2inch size.<br />Xperia X8: It has HVGA but with very small 2 inch size.<br /><br />Here is a detailed comparison with some more competing phones:<br /><div style="overflow: auto; height: 556px; width: 100%;"><br /><table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top" width="130"><b>Model</b></td><td valign="top" width="101"><b>Sony Ericsson Xperia X8</b></td><td valign="top" width="101"><b>Sony Ericsson Xperia X10 Mini</b></td><td valign="top" width="101"><b>Samsung Galaxy 3</b></td><td valign="top" width="101"><b>HTC Wildfire</b></td><td valign="top" width="100"><b>HTC Tattoo A3232</b></td><td valign="top" width="101"><b>Motorola Quench XT3 XT502</b></td><td valign="top" width="101"><b>LG Optimus One</b></td></tr><tr><td valign="top" width="130"><b>Cost@Flipkart.com</b></td><td valign="top" width="101"><p align="right">Rs.13950.00</td><td valign="top" width="101"><p align="right">Rs.12899.00</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101"><p align="right">Rs.11899.00</td><td valign="top" width="101"><p align="right">Rs.15079.00</td><td valign="top" width="100"><p align="right">Rs.12999.00</td><td valign="top" width="101"><p align="right">Rs.12449.00</td><td valign="top" width="101">NA</td></tr><tr><td valign="top" width="130"><b>Specialoffers</b></td><td valign="top" width="101">None</td><td valign="top" width="101">None</td><td valign="top" width="101">Free Reebok Watch worth Rs2599</td><td valign="top" width="101">Free HTC Leather Pouch worth Rs.349</td><td valign="top" width="100">None</td><td valign="top" width="101">Free Adidas Jacket & 4 Movie Tickets of across multiplexes worth Rs.3599</td><td valign="top" width="101">NA</td></tr><tr><td valign="top" width="130"><b>CPU</b></td><td valign="top" width="101">600Mhz</td><td valign="top" width="101">QualcommMSM 7227 600MHz</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">Qualcomm(QSC6270), 667 MHz</td><td valign="top" width="101">QualcommMSM 7225 528 MHz</td><td valign="top" width="100">QualcommMSM 7225 528 MHz</td><td valign="top" width="101">QualcommMSM 7227 600MHz</td><td valign="top" width="101">600MHz processor</td></tr><tr><td valign="top" width="130"><b>Memory</b></td><td valign="top" width="101">128MB?</td><td valign="top" width="101">128MB?</td><td valign="top" width="101">130MB?</td><td valign="top" width="101">384 MBRAM; 512 MB ROM</td><td valign="top" width="100">256 MB RAM, 512 MB ROM</td><td valign="top" width="101">100 MB storage, 256 MB RAM; 512 MB ROM</td><td valign="top" width="101">170 MB</td></tr><tr><td valign="top" width="130"><b>A-GPS</b></td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="100">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td></tr><tr><td valign="top" width="130"><b>Wifi</b></td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="100">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td></tr><tr><td valign="top" width="130"><b>Camera</b></td><td valign="top" width="101"><p align="right">3.15MP</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">5MPAuto-focus?</td><td valign="top" width="101">3.2MP?Auto-focus?</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">5MPAuto-focus?</td><td valign="top" width="100">3.15MPFixed-focus?</td><td valign="top" width="101">3.15MP fixed focus + Flash</td><td valign="top" width="101">3.15MP Auto-focus?</td></tr><tr><td valign="top" width="130"><b>Resolution</b></td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">320 x480 pixels (HVGA)</td><td valign="top" width="101">240 x320 pixels (QVGA)</td><td valign="top" width="101">240 x400 (WQVGA) TFT</td><td valign="top" width="101">240 x320 (QVGA) TFT</td><td valign="top" width="100">240 x320 (QVGA) TFT</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">320 x480 pixels (HVGA)</td><td valign="top" width="101">320 x480 pixels (HVGA) TFT</td></tr><tr><td valign="top" width="130"><b>Size"</b></td><td valign="top" width="101"><p align="right">3</td><td valign="top" width="101"><p align="right">2.55</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101"><p align="right">3.2</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101"><p align="right">3.2</td><td valign="top" width="100"><p align="right">2.8</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101"><p align="right">3.2</td><td valign="top" width="101"><p align="right">3.2</td></tr><tr><td valign="top" width="130"><b>Colors</b></td><td valign="top" width="101">16M</td><td valign="top" width="101">16M</td><td valign="top" width="101">16M</td><td valign="top" width="101">16M</td><td valign="top" width="100">65k</td><td valign="top" width="101">256k</td><td valign="top" width="101">256k</td></tr><tr><td valign="top" width="130"><b>Touch</b></td><td valign="top" width="101">Capacitative</td><td valign="top" width="101">Capacitative</td><td valign="top" width="101">Capacitative</td><td valign="top" width="101">Capacitative</td><td valign="top" width="100">Resistive</td><td valign="top" width="101">Capacitative</td><td valign="top" width="101">Capacitative</td></tr><tr><td valign="top" width="130"><b>Dimensions</b></td><td valign="top" width="101">99.0 x54.0 x 15.0 mm</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">83.0 x50.0 x 16.0mm</td><td valign="top" width="101">113.5x 55 x 12.55 mm</td><td valign="top" width="101">106.8x 60.4 x 12 mm</td><td valign="top" width="100">106 x55.2 x 14 mm</td><td valign="top" width="101">114.9x 56.8 x 12.6 mm</td><td valign="top" width="101">113.5x 59 x 13.3 mm</td></tr><tr><td valign="top" width="130"><b>Weight</b></td><td valign="top" width="101">104g</td><td valign="top" width="101">88g</td><td valign="top" width="101">?</td><td valign="top" width="101">118 g</td><td valign="top" width="100">113 g</td><td valign="top" width="101">114 g</td><td valign="top" width="101">129 g</td></tr><tr><td valign="top" width="130"><b>OS</b></td><td valign="top" width="101">Android1.6</td><td valign="top" width="101">Android1.6</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">Android2.1</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">Android2.1</td><td valign="top" width="100">Android1.6?</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">Android2.1</td><td valign="top" width="101">Android2.2</td></tr><tr><td valign="top" width="130"><b>ExtMemory</b></td><td valign="top" width="101">MicroSDupto 16MB, 2GB included</td><td valign="top" width="101">MicroSDupto 16MB, 2 GB included</td><td valign="top" width="101">MicroSDupto 32MB, 2 GB included</td><td valign="top" width="101">MicroSDupto 32MB, 2 GB included</td><td valign="top" width="100">MicroSD</td><td valign="top" width="101">microSD,up to 32GB. <b>None included</b></td><td valign="top" width="101">microSD,up to 32GB, 2GB included</td></tr><tr><td valign="top" width="130"><b>Battery</b></td><td valign="top" width="101">Li-Po1200 mAh</td><td valign="top" width="101"> Li-Po950 mAh</td><td style="background: none repeat scroll 0% 0% rgb(153, 255, 102);" valign="top" width="101">Li-ion,1,500 mAh</td><td valign="top" width="101">Li-Ion,1300mAh</td><td valign="top" width="100">1100mAh?</td><td valign="top" width="101">Li-Po1270 mAh</td><td valign="top" width="101">Li-Ion1500 mAh</td></tr><tr><td valign="top" width="130"><b>FMRadio</b></td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">?</td><td valign="top" width="101">Y</td><td valign="top" width="100">Y</td><td valign="top" width="101">N?</td><td valign="top" width="101">Y</td></tr><tr><td valign="top" width="130"><b>3.5mmaudio</b></td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="100">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td></tr><tr><td valign="top" width="130"><b>3G</b></td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td><td valign="top" width="100">Y</td><td valign="top" width="101">Y</td><td valign="top" width="101">Y</td></tr></table><br /></div><br /><b>First time Android user</b><br />Since I haven't used Android before, I decided to follow the manual exactly:<br />Open the cover and remove battery (not really necessary to remove battery for inserting sim and memory, but I just wanted to follow the instructions!).<br />Insert Sim and my 8GB Memory card from my Samsung star phone (which died last week after a water attack!)<br />Replace battery.<br />Charge for 3 hours!<br /><br />Finally switched on the phone at 12am. First thing I did was a factory reset.<br /><br /><b>WARNING: Factory Reset will clear all the data on the phone like Contacts, Call logs, installed applications and their data, etc.</b><br />But don't worry if you are doing this on a new phone - factory Reset does not affect any of your data on the memory card nor the data on the Sim.<br /><br />Performing a Factory Reset makes sure that I got a fresh Android OS with no overheads.<br />For Factory Reset, go to<br /><br />After doing the Factory Reset, the phone restarts. After a few minutes, it displays the Welcome message with a Tour which you can skip. Then, it prompts you to enter your Google account details or create a Google account. But I skipped this step as it needs net connectivity and my GPRS plan is very expensive. This step will be prompted when you click on any of the Google apps on the phone like GMail, Lattitude, etc.<br /><br /><b>Pre-installed Apps</b><br />The <b>Gallery</b> app is where all your media is displayed. When I opened this app for the first time, it showed as busy with a message "Loading". I guess it was finding all the 3Gb of pics and videos on my old Memory Card. I switched to another app and when I came after 2 mins, it allowed me to view whatever media was loaded while it continued finding more.<br />But it was REALLY SMOOTH after that! The images are beautifully stacked in the folders. And when clicking on the images loaded them instantly -scrolling to the next pics was just as smooth with instant loading. It think it buffers the next few pics because when I started scrolling through the pics in full screen very fast, my 3MP resolution pics was pixellated and it takes another 1 second for the image to become fully clear.<br /><br />Anyway, the good part is that it is extremley smooth and fast after that first search. I was interesting that it found each and every single image in my memory card from all scattered locations.<br /><br />Maybe it's because I have never owned a multi-touch phone before - but I was downright AMAZED by the pinch and unpinch to Zoom and unzoom pics. I mean not only is it very intuituve but it was SUPER FAST and SMOOTH!!!<br /><br />Another thing is that it showed as busy for about 2 minutes while loading the 2GB pics/videos in my old 8GB Memory Card data before it allowed to start looking at to load all the 3GB of pics n videos in the memory card.<br /><br />The usual Address Book feature is provided via the <b>Contacts</b> app. However, none of the Phone numbers in the Sim are available automatically in the Contacts . Thankfully, there is an option to Import the phone numbers from your Sim - you can select Import All or just choose the numbers you want to import. To import all the 100 odd contacts in my sim, it took about 3 minutes. Like with the one-time slow processes, I simply switched to another task as the Android can Multitask unlike the iPhone you know :)!<br /><br /><B>Battery</B><br />Battery lasts for 1 day with average gaming and calls with no wifi/bluetooth. This was disappointing for me coming from my Samsung Star S5233A which could last me 2 days easily and sometimes even 4. But then this was expected because Android of course supports multi tasking. So you can have your music player runnng, taking cam pics, use your browser, and create a document without closing any of the apps. But since these apps have no close option, they would continue to run in the background for a while before being closed costing precious processor cycles which in turn means more battery usage.<br />To resolve this, there is an app called Advanced Task Killer - this shows all running apps and u can kill the apps from here too. Also, there is a 1 click shortcut which remembers the apps u selected and killed earlier and automatically kills them! So what I do is just click on this shortcut when I am done using the phone. I was able to get 1.5 to 2 days of battery life once I started doing this.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.comtag:blogger.com,1999:blog-2525462180566728820.post-80757639944074209412010-10-26T15:43:00.004+05:302010-10-26T15:44:05.889+05:30Tips while building your own computer<div class=WordSection1> <p class=MsoNormal>Was doing some research for building a computer – was real rusty with the latest info. Summarised my learnings below:<o:p></o:p></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal><b>SMPS<o:p></o:p></b></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo3'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>An SMPS cannot give the complete power that it is rated for. The actual power provided varies with temperature, load on the system, etc.<o:p></o:p></p> <p class=MsoListParagraph>So Corsair VX450W (which is an excellent SMPS) can only give 382.5W at 50% load (that is 85% efficiency. Refer <a href="http://www.anandtech.com/show/2697/39">here</a>). <o:p></o:p></p> <p class=MsoListParagraph>So always buy an SMPS higher than your need.<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l1 level1 lfo3'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Calculate your expected power need of your computer using <a href="http://extreme.outervision.com/psucalculator.jsp">this</a> online calculator.<o:p></o:p></p> <p class=MsoListParagraph>So always buy an SMPS higher than your need.<o:p></o:p></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal><b>Hard Disks<o:p></o:p></b></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>For faster speeds, go for a 7200rpm HDD instead of 5400rpm.<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>A HDD with higher cache (32MB is really good) improves real-life file copy speeds dramatically (especially when going for a slower rpm HDD).<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Theoretical Interface Speeds:<o:p></o:p></p> <p class=MsoNormal style='margin-left:.5in'>SATA 3.0 (6Gbps/600Mbps) > USB 3.0 (5Gbps) > SATA 2.0 (3.0Gbps) > SATA 1.0 (1.5Gbps/150 MBps) > USB 2.0 (60MBps)<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>eSATA and eSATAP have the same speeds as the respective SATA versions.<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>eSATA devices need additional power via a separate power cable. USB and eSATAP have built in power through the cable<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Unlike USB 2, USB 3.0 is bidirectional like all the SATA versions.<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>All USB interfaces (including 3.0) need some bridging to communicate to the HDD ports on the MB which definitely slows down actual data throughput (refer <a href="http://www.itworld.com/hardware/98987/usb-30-vs-esata-is-faster-better?page=0,1">here</a>)<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>For current magnetic HDD transfer rate of 240Mbit/s (average), the latest SATA3.0 or USB 3 interface is overkill. But the latest solidstate drives push the boundary to 355 (refer <a href="http://www.micron.com/products/solid_state_storage/">here</a>) and can benefit from SATA III…<o:p></o:p></p> <p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>If you have 2 drives, try to setup a Raid 1+0 configuration. This gives you much faster speeds and also disk failure tolerance. But the cost is that less space will be available. See how here<o:p></o:p></p> <p class=MsoNormal><o:p> </o:p></p> </div>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-51037910659697143392010-10-11T00:07:00.005+05:302010-11-12T00:20:48.810+05:30Dangerous scripts - safety tipsHadn't checked Orkut for a while - and was shocked to yesterday to see a virulent script-worm spreading across it... even some of my very net-savvy friends were victims too.<br /><br />If you clicked on this script link while logged in to Orkut, it steals your password, enrolls u automatically in strange communities, and makes auto-spam posts onto all your friends testimonials, communities, etc. Read details here: <a href="http://www.google.co.in/support/forum/p/orkut/thread?tid=0cbd83ba084be690&hl=en">http://www.google.co.in/support/forum/p/orkut/thread?tid=0cbd83ba084be690&hl=en</a><br /><br /><br />Bottlomline - don't get on the net if you can't learn these simple safety tips:<br />1) Don't blindly click on Yes when getting browser prompts to run suspicious scripts.<br />2) Don't ever click on suspicious links or emails even if it's from someone you know well.<br />3) Don't ever ever click on suspicious links or emails while you are logged on into an online account (specially popular ones like Yahoo, gmail, orkut, facebook, etc)<br /><br />Also, have at least one good Firewall software running (even though XP onwards have one built-in). Even a free one like Commodo if you are advanced enough.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-29558473766164943882010-09-20T16:03:00.002+05:302011-07-18T00:27:20.698+05:30UK Postcode regular expression<div class="WordSection1"> <p class="MsoNormal">A friend of mine asked for a regular expression for UK Post codes… got so many confusing results on the net that I decided to make it myself.<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">First had to find the rules for UK Postcode. A quick search got me a UK government site, (old site was: http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx as of October 2009. Updated to new site) <a href="http://interim.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx">http://interim.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx</a>, as of July 2011, which shows the rules as follows:<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <table class="MsoNormalTable" style="margin-left: 13.1pt; border-collapse: collapse; border: medium none;" border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <td style="border: 1pt solid windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;"><b>Permitted Format<o:p></o:p></b></p> </td> <td style="border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;"><b>Example Postcode<o:p></o:p></b></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">AN NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">M1 1AA<o:p></o:p></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">ANN NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">M60 1NW<o:p></o:p></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">AAN NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">CR2 6XH<o:p></o:p></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">AANN NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">DN55 1PT<o:p></o:p></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">ANA NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">W1A 1HQ<o:p></o:p></p> </td> </tr> <tr> <td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 5.45pt;">AANA NAA<o:p></o:p></p> </td> <td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt;" valign="top"> <p class="MsoNormal" style="margin-left: 11.6pt;">EC1A 1BB<o:p></o:p></p> </td> </tr> </tbody></table> <p class="MsoNormal">Also<o:p></o:p></p> <p class="MsoNormal"> * The letters Q, V and X are not used in the first position.<o:p></o:p></p> <p class="MsoNormal"> * The letters I, J and Z are not used in the second position.<o:p></o:p></p> <p class="MsoNormal"> * The only letters to appear in the third position are A, B, C, D, E, F, G, H, J, K, S, T, U and W.<o:p></o:p></p> <p class="MsoNormal"> * The only letters to appear in the fourth position are A, B, E, H, M, N, P, R, V, W, X and Y.<o:p></o:p></p> <p class="MsoNormal"> * The second half of the Postcode is always consistent numeric, alpha, alpha format and the letters C, I, K, M, O and V are never used.<o:p></o:p></p> <p class="MsoNormal"> * GIR 0AA is a Postcode that was issued historically and does not confirm to current rules on valid Postcode formats, It is however, still in use.<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">Was able to come up with this basic Regular expression that does UK Postcode validation:<o:p></o:p></p> <p class="MsoNormal">^([A-PR-UWYZ](([0-9](([0-9]|[A-HJKSTUW])?)?)|([A-HK-Y][0-9]([0-9]|[ABEHMNPRVWXY])?)) [0-9][ABD-HJLNP-UW-Z]{2})|GIR 0AA$<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">This will validate 100% as per the assumed rules above.<br />Note however that it is certainly <b>not</b> optimized… I couldn't find any online regular expression optimizer and I’ll have to become a regex expert to do anything about it. Maybe I can take automatic regex optmizer thing as a mini-project. But for now, the unoptimized version will have to do...<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">Here is the regular expression in action inside Java code:<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p> <div style="border: 1pt solid windowtext; padding: 1pt 4pt;"> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > </span><b><span style=";font-family:";font-size:10pt;" >public</span></b><span style=";font-family:";font-size:10pt;color:black;" > </span><b><span style=";font-family:";font-size:10pt;" >static</span></b><span style=";font-family:";font-size:10pt;color:black;" > </span><b><span style=";font-family:";font-size:10pt;" >void</span></b><span style=";font-family:";font-size:10pt;color:black;" > <span style="background: none repeat scroll 0% 0% silver;">validate</span>(String code) {</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > String regexp=</span><span style=";font-family:";font-size:10pt;" >"^([A-PR-UWYZ](([0-9](([0-9]|[A-HJKSTUW])?)?)|([A-HK-Y][0-9]([0-9]|[ABEHMNPRVWXY])?)) [0-9][ABD-HJLNP-UW-Z]{2})|GIR 0AA$"</span><span style=";font-family:";font-size:10pt;color:black;" >;</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > Pattern pattern = Pattern.<i>compile</i>(regexp);</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > Matcher matcher = pattern.matcher(</span><span style=";font-family:";font-size:10pt;color:black;" >code.toUpperCase());</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > </span><b><span style=";font-family:";font-size:10pt;" >if</span></b><span style=";font-family:";font-size:10pt;color:black;" > (matcher.matches()) {</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > System.</span><i><span style=";font-family:";font-size:10pt;" >out</span></i><span style=";font-family:";font-size:10pt;color:black;" >.println(</span><span style=";font-family:";font-size:10pt;" >"This is a valid UK Postcode."</span><span style=";font-family:";font-size:10pt;color:black;" >);</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > } </span><b><span style=";font-family:";font-size:10pt;" >else</span></b><span style=";font-family:";font-size:10pt;color:black;" > {</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > System.</span><i><span style=";font-family:";font-size:10pt;" >out</span></i><span style=";font-family:";font-size:10pt;color:black;" >.println(</span><span style=";font-family:";font-size:10pt;" >"This is not a valid UK Postcode."</span><span style=";font-family:";font-size:10pt;color:black;" >);</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > }</span><span style=";font-family:";font-size:10pt;" ><o:p></o:p></span></p> <p class="MsoNormal" style="border: medium none; padding: 0in;"><span style=";font-family:";font-size:10pt;color:black;" > }<o:p></o:p></span></p> </div> <p class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">In a real life scenario, you may need to convert the received code into upper case before calling validate to be safe. Or better yet, have upper and lower case validation inside the regular expression itself! Plus of course the optimization…<o:p></o:p></p> </div>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com8tag:blogger.com,1999:blog-2525462180566728820.post-4839734162141115152010-05-12T22:37:00.004+05:302018-04-20T17:50:34.413+05:30Support for NTLMv2 with Apache HttpClient using JCIFS<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="gmail_quote">
<div lang="EN-US" link="blue" vlink="purple">
Here, I'll explain how to get NTLMv2 support in HttpClient 3.x using JCIFS by using 1 addditional class and inserting 1 new line into your existing calls to HttpClient.<br /><i>Of course you can use JCIFS NTLM authentication directly in Java even if you don't have Apache HttpClient - I'm not looking at that but you can refer to <a href="http://jcifs.samba.org/src/docs/httpclient.html">this</a> guide on JCIFS home page.</i> <br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>HttpClient</b></div>
<div class="MsoNormal">
Apache's HttpClient provides some useful encapsulation for fetching/posting data over HTTP through Java code. The common version is <a href="http://hc.apache.org/httpclient-3.x" target="_blank">HttpClient 3.x</a> whereas the latest version is <a href="http://hc.apache.org/httpcomponents-client-ga/index.html" target="_blank">HttpClient 4.x</a>.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>NTLM</b></div>
<div class="MsoNormal">
One of HttpClient's advantages is that it has built in support to manage communications over an NTLM proxy.</div>
<div class="MsoNormal">
NTLM is a very closely guarded Proxy protocol used by Microsoft but still popularly used.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>JCIFS</b></div>
<div class="MsoNormal">
Unfortunately, HttpClient does not have built in support for NTLM v2. The good news is, it allows you to integrate NTLMv2 support through another library called JCIFS.</div>
<div class="MsoNormal">
JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java. See more details/download from <a href="http://jcifs.samba.org/" target="_blank">here</a>. But since JCIFS started NTLMv2 support only from 1.3.0, make sure you have the latest JCIFS jar (I tested with JCIFS 1.3.14).</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>JCIFS in HttpClient</b></div>
<div class="MsoNormal">
Thankfully, HttpClient 4.x home site has a <a href="http://hc.apache.org/httpcomponents-client-ga/ntlm.html" target="_blank">page</a> containing unofficial steps for integrating JCIFS into HTTPClient. However, these steps will only work for 4.x and not for for 3.x. This is because HttpClient 4.x is not backward compatible with 3.x. There are major changes like package structures, new Engines instead of States, etc.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Since I was using HttpClient 3.x, I started thinking of upgrading to 4.x – but it was obvious upgrading to 4.x from 3.x was a nightmare just to get NTLMv2 support.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Thankfully, it was just a matter of understanding HttpClient 3.x internal calls from the source. I was able to create 1 simple class that will do the integration in 1 smooth move.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>Steps and source-code</b></div>
<div class="MsoNormal">
1)<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span>I created a new class, JCIFS_NTLMScheme.java that would be used in place of HTTPClient's NTLMScheme.</div>
This new class simply makes calls to JCIFS internally to generate NTLMv2's Type1, 2 and 3 messages- just reimplemented the methods with slight logic changes to generate the messages:<br />
<div style="border: 1pt solid; margin-left: 0.5in; margin-right: 0in; padding: 1pt;">
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">package</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.xyz;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> java.io.IOException;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.Credentials;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.HttpMethod;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.NTCredentials;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.auth.AuthChallengeParser;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.auth.AuthScheme;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.auth.AuthenticationException;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.auth.InvalidCredentialsException;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.apache.commons.httpclient.auth.MalformedChallengeException;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.sac.crosspather.common.util.AppLogger;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">import</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> org.sac.crosspather.common.util.HTTPHelper;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">This</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">a</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">reimplementation</span></u><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">HTTPClient</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3.x's</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">org</span></u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">.<u>apache</u>.commons.<u>httpclient</u>.<u>auth</u>.NTLMScheme.<BR/></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">It</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">will</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">basically</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">use</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">JCIFS</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">(v1.3.15)</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">in</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">order</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">provide</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">added</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">support</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">for</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLMv2</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">(instead</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">trying</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">create</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">its</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">own</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Type,</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">2</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">and</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">messages).</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;"><BR/></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">This</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">class</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">has</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">be</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">registered</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">manually</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">with</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">HTTPClient</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">before</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">setting</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTCredentials:</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">AuthPolicy.registerAuthScheme(AuthPolicy.NTLM,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">JCIFS_NTLMScheme.class);</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;"><BR/></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Will</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><B></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">not</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></B></span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">work</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">with</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">HttpClient</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">4.x</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">which</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">requires</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">AuthEngine</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">be</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">overriden</span></u><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">instead</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">AuthScheme.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@author</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Sachin M</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">class</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> JCIFS_NTLMScheme </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">implements</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AuthScheme {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AppLogger </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">logger</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AppLogger(HTTPHelper.</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">class</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.getName());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">challenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">string.</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String </span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">ntlmchallenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">UNINITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = 0;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">INITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = 1;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE1_MSG_GENERATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = 2;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE2_MSG_RECEIVED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = 3;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE3_MSG_GENERATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = 4;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">FAILED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = Integer.</span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">MAX_VALUE</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">process</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> JCIFS_NTLMScheme() </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throws</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AuthenticationException {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 127 , 95); font-family: "courier new"; font-size: 8pt;">// Check if JCIFS is present. If not present, do not proceed.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">try</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> Class.<i>forName</i>(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"jcifs.ntlmssp.NtlmMessage"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">,</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">false</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">,</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.getClass().getClassLoader());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">catch</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (ClassNotFoundException e) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AuthenticationException(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Unable to proceed as JCIFS library is not found."</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String authenticate(Credentials credentials, HttpMethod method)</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throws</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AuthenticationException {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">logger</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">.doLog(AppLogger.</span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">FINEST</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Enter JCIFS_NTLMScheme.authenticate(Credentials, HttpMethod)"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">UNINITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> IllegalStateException(</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"NTLM authentication process has not been initiated"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> NTCredentials ntcredentials = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">try</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> ntcredentials = (NTCredentials) credentials;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">catch</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (ClassCastException e) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> InvalidCredentialsException(</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Credentials cannot be used for NTLM authentication: "</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> + credentials.getClass().getName());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> NTLM ntlm = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> NTLM();</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> ntlm.setCredentialCharset(method.getParams().getCredentialCharset());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> String response = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">INITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> || </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">FAILED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> response = ntlm.generateType1Msg(ntcredentials.getHost(),</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> ntcredentials.getDomain());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE1_MSG_GENERATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">else</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> response = ntlm.generateType3Msg(ntcredentials.getUserName(),</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> ntcredentials.getPassword(), ntcredentials.getHost(),</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> ntcredentials.getDomain(), </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">ntlmchallenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE3_MSG_GENERATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"NTLM "</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> + response;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String authenticate(Credentials credentials, String method,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> String uri) </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throws</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> AuthenticationException {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> RuntimeException(</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Not implemented as it is deprecated anyway in Httpclient 3.x"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String getID() {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> RuntimeException(</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Not implemented as it is deprecated anyway in Httpclient 3.x"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Returns</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">parameter</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">with</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">given</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">name,</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">if</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">available.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><p></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">There</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">are</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">no</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">valid</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">parameters</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">for</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">so</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">this</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">method</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">always</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">returns</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">null</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></p></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@param</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">name</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">The</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">name</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">parameter</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">be</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">returned</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">parameter</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">with</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">given</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">name</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String getParameter(String name) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (name == </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> IllegalArgumentException(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Parameter name may not be null"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">The</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">concept</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">an</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">realm</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">not</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">supported</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">by</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">scheme.</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Always</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">returns</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><code></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">null</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></code></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><code></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">null</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></code></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String getRealm() {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">null</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Returns</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">textual</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">designation</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">of</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">scheme.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><code></span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">ntlm</span></u><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></code></span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String getSchemeName() {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"ntlm"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Tests</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">if</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">process</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">has</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">been</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">completed.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">true</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></tt></span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">if</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Basic</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authorization</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">has</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">been</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">processed,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">false</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></tt></span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">otherwise.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@since</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3.0</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">boolean</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> isComplete() {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE3_MSG_GENERATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> || </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">FAILED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Returns</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">true</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">.</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">scheme</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">connection</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">based.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"><tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">true</span><span style="color: rgb(127 , 127 , 159); font-family: "courier new"; font-size: 8pt;"></tt></span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@since</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3.0</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">boolean</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> isConnectionBased() {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">true</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Processes</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">challenge.</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@param</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">challenge</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">challenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">string</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@throws</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">MalformedChallengeException</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">thrown</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">if</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">authentication</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">challenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">malformed</span></u><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 159 , 191); font-family: "courier new"; font-size: 8pt;">@since</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3.0</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">void</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> processChallenge(</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String challenge)</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throws</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> MalformedChallengeException {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> String s = AuthChallengeParser.<i>extractScheme</i>(challenge);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (!s.equalsIgnoreCase(getSchemeName())) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> MalformedChallengeException(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Invalid NTLM challenge: "</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> + challenge);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">int</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> i = challenge.indexOf(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">' '</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (i != -1) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> s = challenge.substring(i, challenge.length());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">ntlmchallenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = s.trim();</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">TYPE2_MSG_RECEIVED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">else</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">ntlmchallenge</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">""</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">if</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> == </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">UNINITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">INITIATED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">else</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">state</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">FAILED</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">class</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> NTLM {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Character</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">encoding</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">public</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">static</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">final</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">DEFAULT_CHARSET</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"ASCII"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">/**</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">The</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">character</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">was</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">used</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">by</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">3.x's</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTLM</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">encode</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">username</span></u><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">and</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">password.</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">Apparently,</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">this</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">is</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">not</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">needed</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">in</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">when</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">passing</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">username</span></u><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">password</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">from</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">NTCredentials</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">to</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">the</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">JCIFS</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">library</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="color: rgb(63 , 95 , 191); font-family: "courier new"; font-size: 8pt;">*/</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String </span><u><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">credentialCharset</span></u><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = </span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">DEFAULT_CHARSET</span></i><span style="color: black; font-family: "courier new"; font-size: 8pt;">;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">void</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> setCredentialCharset(String credentialCharset) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">this</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;">.</span><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 8pt;">credentialCharset</span><span style="color: black; font-family: "courier new"; font-size: 8pt;"> = credentialCharset;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String generateType1Msg(String host, String domain) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type1Message t1m = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type1Message(jcifs.ntlmssp.Type1Message.getDefaultFlags(),</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> domain, host);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.util.Base64.encode(t1m.toByteArray());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">private</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> String generateType3Msg(String username, String password, String host,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> String domain, String challenge) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type2Message t2m;</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">try</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> t2m = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type2Message(jcifs.util.Base64.decode(challenge));</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> } </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">catch</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> (IOException e) {</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">throw</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> RuntimeException(</span><span style="color: rgb(42 , 0 , 255); font-family: "courier new"; font-size: 8pt;">"Invalid Type2 message"</span><span style="color: black; font-family: "courier new"; font-size: 8pt;">, e);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type3Message t3m = </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">new</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.ntlmssp.Type3Message(t2m, password, domain,</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> username, host, 0);</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> </span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 8pt;">return</span></b><span style="color: black; font-family: "courier new"; font-size: 8pt;"> jcifs.util.Base64.encode(t3m.toByteArray());</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;"> }</span><span style="font-family: "courier new"; font-size: 8pt;"></span></div>
<div class="MsoNormal" style="border: medium none; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 8pt;">}</span><span style="font-family: "courier new"; font-size: 10pt;"></span></div>
</div>
<br />
2)<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"> </span>Then it was Register the new JCIFS_NTLMScheme class as the replacement for NTLMScheme by using the following command:<br />
<div style="border: 1pt solid; margin-left: 0.5in; margin-right: 0in; padding: 1pt 4pt;">
<div style="border: medium none; margin-left: 0in; padding: 0in;">
<span style="color: black; font-family: "courier new"; font-size: 10pt;">AuthPolicy.<i>registerAuthScheme</i>(AuthPolicy.</span><i><span style="color: rgb(0 , 0 , 192); font-family: "courier new"; font-size: 10pt;">NTLM</span></i><span style="color: black; font-family: "courier new"; font-size: 10pt;">, org.xyz.JCIFS_NTLMScheme.</span><b><span style="color: rgb(127 , 0 , 85); font-family: "courier new"; font-size: 10pt;">class</span></b><span style="color: black; font-family: "courier new"; font-size: 10pt;">);</span><span style="font-family: "courier new"; font-size: 10pt;"></span></div>
</div>
(<span style="color: black; font-family: "courier new"; font-size: 10pt;">AuthPolicy</span> is a class in HTTPClient 3.x jar)<br />
<br />
<div class="MsoNormal">
That's it! Use your HTTPClient as normal but just make sure you call the above register command before you create and bind the HttpClient's NTCredentials class</div>
</div>
</div>
</div>
Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com42tag:blogger.com,1999:blog-2525462180566728820.post-34262624235259685292009-10-22T18:39:00.015+05:302010-11-12T00:19:39.086+05:30Best Software Utilities (Non-IT) ListHere's a list of my favourite, eternally useful list of extremely useful Software Utilities / Tools.<br /><br />It will be a Forever Updated post, with new additions regularly for Windows - obviously with a slight preference to Java + Open-source versions if competing apps are similar.<br />For Best Developer Utilities, see this earlier post, <a href="http://devsac.blogspot.com/2008/10/must-have-tools-for-every-smart-java.html">Must have tools for the Smart Java Professional</a>.<br /><br /><span style="font-style: italic;">If an app replaces an existing one, or if there are close seconds, the losing app will move to the Best Software Utilities (non-IT) Honour List.</span><br /><br /><span style="font-weight: bold;">Find out whats eating your Hard Disk space</span><br /><a href="http://windirstat.sourceforge.net/">WinDirStat</a>: Gives a very unique visual categorization of which files and folders contain what. <span style="font-weight: bold;font-size:85%;" >OpenSource, Windows</span><br /><a href="http://foldersize.codeplex.com/">FolderSize</a>: A quick way to analyse your usage but without advanced features. <span style="font-size:85%;"><span style="font-weight: bold;">Freeware, Windows</span></span><br /><a href="http://jgoodies.com/freeware/jdiskreport">JDiskReport</a>: A Java-based disk analyser. <span style="font-weight: bold;font-size:85%;" >Freeware, Java</span><br /><br /><span style="font-weight: bold;">Recover Lost Files</span><br /><a href="http://ntfsundelete.com/">NTFS Undelete</a>: Free software ported from the open-source Unix version of ntfs undelete utility. EXCELLENT! <span style="font-weight: bold;font-size:85%;" >OpenSource, Windows</span><br /><br /><span style="font-weight: bold;">Watch any video format without installing codecs</span><br /><a href="http://www.videolan.org/vlc/">VLC media player</a>: Free all-in-one media player that plays every video format out there without additional codecs <span style="font-weight: bold;font-size:85%;" >OpenSource, Windows</span>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com9tag:blogger.com,1999:blog-2525462180566728820.post-17928726960388812882009-07-14T17:13:00.020+05:302012-02-15T00:06:59.237+05:30Error in Tolven RC1 configPhase3 - ORA-00932Running configPhase3.bat of Tolven RC1 (with Windows-OpenLdap/Oracle10g/Jboss) was causing errors.<br /><br />The command prompt showed:<br /><span class="code-large">C:\tolven\tolven-RC1\bin>configPhase3.bat<br />0 [main] INFO root - Start log4j - Configuration: file:/C:/tolven/tolven-RC1/bi<br />n/tolven-log4j.xml, logFileName: C:\tolven\tolven-RC1\log\tolven.log<br />18:29:07,570 INFO [TPFBoot] Loaded configDir C:\tolven\tolven-config<br />18:29:07,695 INFO [TPFBoot] Generated boot.properties: C:\DOCUME~1\sachin\LOC<br />ALS~1\Temp\tpf_7376485784350116145_boot.properties<br />18:29:07,757 INFO [TolvenApplicationInitializer] logging system initialized<br />18:29:07,757 INFO [TolvenApplicationInitializer] application root is C:\tolven\<br />tolven-RC1\bin<br />18:29:08,023 INFO [PluginRegistryImpl] configured, stopOnError=true, isValidati<br />ng=false<br />18:29:08,132 INFO [ShadingPathResolver] configured, shadow folder is C:\tolven\<br />tolven-config\build\temp\.jpf-shadow<br />18:29:08,757 INFO [PluginRegistryImpl] plug-in and fragment descriptors registe<br />red - 117<br />18:29:08,804 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.library.jasperreports-0.0.1.zip has<br />been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/o<br />rg.tolven.library.jasperreports-0.0.1.zip for {PluginFragment: uid=org.tolven.li<br />brary.jasperreports@0.0.1} with key org.tolven.library.jasperreports<br />18:29:08,804 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.assembler.jboss.oracle-0.0.1.zip has<br />been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/<br />org.tolven.assembler.jboss.oracle-0.0.1.zip for {PluginFragment: uid=org.tolven.<br />assembler.jboss.oracle@0.0.1} with key org.tolven.assembler.jboss.oracle<br />18:29:08,804 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.library.jboss-0.0.1.zip has been rep<br />laced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/org.tolve<br />n.library.jboss-0.0.1.zip for {PluginFragment: uid=org.tolven.library.jboss@0.0.<br />1} with key org.tolven.library.jboss<br />18:29:08,804 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.assembler.jboss-0.0.2.zip has been r<br />eplaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/org.tol<br />ven.assembler.jboss-0.0.2.zip for {PluginFragment: uid=org.tolven.assembler.jbos<br />s@0.0.1} with key org.tolven.assembler.jboss<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.deploy.source-0.0.2.zip has been rep<br />laced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/org.tolve<br />n.deploy.source-0.0.2.zip for {PluginFragment: uid=org.tolven.deploy.source@0.0.<br />1} with key org.tolven.deploy.source<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.assembler.oracle.persistencexml-0.0.<br />1.zip has been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime<br />/plugins/org.tolven.assembler.oracle.persistencexml-0.0.1.zip for {PluginFragmen<br />t: uid=org.tolven.assembler.oracle.persistencexml@0.0.1} with key org.tolven.ass<br />embler.oracle.persistencexml<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.component.oracle.init-0.0.1.zip has<br />been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/o<br />rg.tolven.component.oracle.init-0.0.1.zip for {PluginFragment: uid=org.tolven.co<br />mponent.oracle.init@0.0.1} with key org.tolven.component.oracle.init<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.deploy.jboss-0.0.3.zip has been repl<br />aced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/org.tolven<br />.deploy.jboss-0.0.3.zip for {PluginFragment: uid=org.tolven.deploy.jboss@0.0.1}<br />with key org.tolven.deploy.jboss<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.component.application.oracle.indexes<br />-0.0.1.zip has been replaced with new file:/C:/tolven/tolven-config/repositoryRu<br />ntime/plugins/org.tolven.component.application.oracle.indexes-0.0.1.zip for {Plu<br />ginFragment: uid=org.tolven.component.application.oracle.indexes@0.0.1} with key<br />org.tolven.component.application.oracle.indexes<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.assembler.oracle.orm-0.0.1.zip has b<br />een replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/or<br />g.tolven.assembler.oracle.orm-0.0.1.zip for {PluginFragment: uid=org.tolven.asse<br />mbler.oracle.orm@0.0.1} with key org.tolven.assembler.oracle.orm<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.component.application.jboss-0.0.1.zi<br />p has been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plu<br />gins/org.tolven.component.application.jboss-0.0.1.zip for {PluginFragment: uid=o<br />rg.tolven.component.application.jboss@0.0.1} with key org.tolven.component.appli<br />cation.jboss<br />18:29:08,820 WARN [ShadingPathResolver] old context URL file:/C:/tolven/tolven-<br />config/repositoryRuntime/plugins/org.tolven.deploy.pluginframework-0.0.1.zip has<br />been replaced with new file:/C:/tolven/tolven-config/repositoryRuntime/plugins/<br />org.tolven.deploy.pluginframework-0.0.1.zip for {PluginFragment: uid=org.tolven.<br />deploy.pluginframework@0.0.1} with key org.tolven.deploy.pluginframework<br />18:29:08,929 INFO [TolvenApplicationInitializer] integrity check done: errors -<br />0, warnings - 0<br />18:29:08,929 INFO [TolvenApplicationInitializer] application plug-in is org.tol<br />ven.command<br />18:29:08,929 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />pluginframework@0.0.1 (active/total: 1 of 105)<br />18:29:08,929 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />serverconfig@0.0.2 (active/total: 2 of 105)<br />18:29:08,945 INFO [StandardPluginManager] plug-in started - org.tolven.command@<br />0.0.3 (active/total: 3 of 105)<br />18:29:08,945 INFO [StandardPluginManager] plug-in started - org.tolven.config.d<br />atabase@0.0.1 (active/total: 4 of 105)<br />18:29:08,960 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />bouncy-castle@0.0.1 (active/total: 5 of 105)<br />18:29:08,960 INFO [StandardPluginManager] plug-in started - org.tolven.config.l<br />dap@0.0.1 (active/total: 6 of 105)<br />18:29:08,976 INFO [AdminAssembler] *** start ***<br />18:29:09,179 INFO [AdminAssembler] tmpDir - c:\tolven\tolven-config\build\repos<br />itoryTmp<br />18:29:09,179 INFO [AdminAssembler] stageDir - c:\tolven\tolven-config\build\rep<br />ositoryStage<br />18:29:09,179 INFO [AdminAssembler] devLib - c:\tolven\tolven-config\devLib<br />18:29:09,195 INFO [AdminAssembler] Admin keystore: c:\tolven\tolven-config\cred<br />entials\admin\tolvendev-admin.jks<br />18:29:09,195 INFO [AdminAssembler] Admin truststore: c:\tolven\tolven-config\cr<br />edentials\admin\tolvendev-admin-cacerts.jks<br />18:29:09,210 INFO [AdminAssembler] Admin secretkey: c:\tolven\tolven-config\cre<br />dentials\admin\admin-encryptedSecretKey<br />18:29:09,210 INFO [AdminAssembler] Admin password store: c:\tolven\tolven-confi<br />g\credentials\admin\admin-password.cfg<br />18:29:09,804 INFO [AdminAssembler] LDAP key: c:\tolven\tolven-config\credential<br />s\ldap\tolvendev-ldap-key.pem<br />18:29:09,804 INFO [AdminAssembler] LDAP certificate: c:\tolven\tolven-config\cr<br />edentials\ldap\tolvendev-ldap-cert.pem<br />18:29:09,804 INFO [AdminAssembler] LDAP truststore: c:\tolven\tolven-config\cre<br />dentials\ldap\tolvendev-ldap-cacerts.pem<br />18:29:09,804 INFO [AdminAssembler] LDAPClient key: c:\tolven\tolven-config\cred<br />entials\ldapclient\tolvendev-ldapclient-key.pem<br />18:29:09,820 INFO [AdminAssembler] Database keystore: c:\tolven\tolven-config\c<br />redentials\oracle\tolvendev-oracle.jks<br />18:29:09,820 INFO [AdminAssembler] Database truststore: c:\tolven\tolven-config<br />\credentials\oracle\root.crt<br />18:29:09,835 INFO [AdminAssembler] DatabaseClient key: c:\tolven\tolven-config\<br />credentials\pgadmin\postgresql.key<br />18:29:09,835 INFO [AdminAssembler] DatabaseClient certificate: c:\tolven\tolven<br />-config\credentials\pgadmin\postgresql.crt<br />18:29:09,851 INFO [AdminAssembler] AppServer keystore: c:\tolven\tolven-config\<br />credentials\jboss\tolvendev-jboss.jks<br />18:29:09,851 INFO [AdminAssembler] AppServer truststore: c:\tolven\tolven-confi<br />g\credentials\jboss\tolvendev-jboss-cacerts.jks<br />18:29:09,851 INFO [AdminAssembler] MDBUser key: c:\tolven\tolven-config\credent<br />ials\mdbuser\tolvendev-mdbuser-key.pem<br />18:29:09,867 INFO [AdminAssembler] MDBUser certificate: c:\tolven\tolven-config<br />\credentials\mdbuser\tolvendev-mdbuser-cert.pem<br />18:29:09,867 INFO [AdminAssembler] MDBUser keystore: c:\tolven\tolven-config\cr<br />edentials\mdbuser\tolvendev-mdbuser.p12<br />18:29:10,164 INFO [TolvenConfigWrapper] Load JSSE keystore for admin<br />18:29:10,164 INFO [TolvenConfigWrapper] Load JSSE truststore for admin<br />18:29:10,164 INFO [AdminAssembler] *** end ***<br />18:29:10,164 INFO [StandardPluginManager] plug-in started - org.tolven.assemble<br />r.admin@0.0.4 (active/total: 7 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />jasperreports@0.0.1 (active/total: 8 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />remoteclient@0.0.1 (active/total: 9 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />jboss@0.0.1 (active/total: 10 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />tolvenclient@0.0.2 (active/total: 11 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />javaee@0.0.1 (active/total: 12 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />jdbcdriver@0.0.1 (active/total: 13 of 105)<br />18:29:10,179 INFO [StandardPluginManager] plug-in started - org.tolven.componen<br />t.application.jboss@0.0.1 (active/total: 14 of 105)<br />18:29:10,195 INFO [StandardPluginManager] plug-in started - org.tolven.library.<br />application@0.0.1 (active/total: 15 of 105)<br />18:29:10,257 INFO [Application] *** start ***<br />18:29:10,273 INFO [Application] Starting for user: admin to jnp://localhost:109<br />9<br />18:29:10,429 INFO [Application] Update MDBUser mdbuser<br />18:29:10,429 INFO [TolvenClient] jndi: java.naming.provider.url=jnp://localhost<br />:1099<br />18:29:10,429 INFO [TolvenClient] jndi: java.naming.factory.initial=org.jboss.na<br />ming.NamingContextFactory<br />18:29:10,429 INFO [TolvenClient] jndi: java.naming.factory.url.pkgs=org.jboss.n<br />aming:org.jnp.interfaces<br /><b>18:29:11,523 INFO [LoadMDBUsers] Rolling back transaction : load mdbuser for: a<br />dmin<br />Application start failed.<br />org.java.plugin.PluginLifecycleException: can't start plug-in org.tolven.compone<br />nt.application@0.0.1<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:415)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:245)<br />at org.tolven.command.TolvenApplication.startRequiredPlugins(TolvenAppli<br />cation.java:87)<br />at org.tolven.command.TolvenApplication.startApplication(TolvenApplicati<br />on.java:56)<br />at org.java.plugin.boot.Boot.boot(Boot.java:346)<br />at org.java.plugin.boot.Boot.main(Boot.java:243)<br />at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:102)<br />Caused by: java.lang.RuntimeException: Could not load mdbuser for: admin<br />at org.tolven.client.load.LoadMDBUsers.updateMDBUser(LoadMDBUsers.java:3<br />0)<br />at org.tolven.component.application.Application.updateMDBUser(Applicatio<br />n.java:152)<br />at org.tolven.component.application.Application.doStart(Application.java<br />:123)<br />at org.java.plugin.Plugin.start(Plugin.java:82)<br />at org.java.plugin.PluginManager.startPlugin(PluginManager.java:325)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:407)<br />... 6 more<br />Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.<br />SQLGrammarException: could not execute query<br />at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)<br /><br />at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)<br />at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java<br />:195)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt<br />erceptor.java:86)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles<br />sInstanceInterceptor.java:62)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(R<br />oleBasedAuthorizationInterceptor.java:166)<br />at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(Role<br />BasedAuthorizationInterceptor.java:115)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic<br />ationInterceptor.java:77)<br />at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth<br />enticationInterceptor.java:110)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce<br />ptor.java:46)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono<br />usInterceptor.java:106)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo<br />ntainer.java:304)<br />at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)<br />at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem<br />otingInvocationHandler.java:82)<br />at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)<br />at org.jboss.remoting.transport.socket.ServerThread.processInvocation(Se<br />rverThread.java:573)<br />at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.j<br />ava:373)<br />at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.jav<br />a:166)<br />Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGr<br />ammarException: could not execute query<br />at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException<br />(AbstractEntityManagerImpl.java:629)<br />at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)<br />at org.tolven.security.bean.LoginBean.findUser(LoginBean.java:73)<br />at org.tolven.security.bean.LoginBean.createOrUpdateUser(LoginBean.java:<br />314)<br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br />java:39)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces<br />sorImpl.java:25)<br />at java.lang.reflect.Method.invoke(Method.java:597)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:112)<br />at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo<br />ntextImpl.java:166)<br />at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int<br />erceptorsInterceptor.java:63)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok<br />e(TransactionScopedEntityManagerInterceptor.java:54)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI<br />nterceptor.java:47)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)<br />at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java<br />:195)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt<br />erceptor.java:86)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles<br />sInstanceInterceptor.java:62)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(R<br />oleBasedAuthorizationInterceptor.java:166)<br />at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(Role<br />BasedAuthorizationInterceptor.java:115)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic<br />ationInterceptor.java:77)<br />at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth<br />enticationInterceptor.java:110)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce<br />ptor.java:46)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono<br />usInterceptor.java:106)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo<br />ntainer.java:304)<br />at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)<br />at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem<br />otingInvocationHandler.java:82)<br />at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)<br />at org.jboss.remoting.transport.socket.ServerThread.processInvocation(Se<br />rverThread.java:573)<br />at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.j<br />ava:373)<br />at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.jav<br />a:166)<br />at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientI<br />nvoker.java:163)<br />at org.jboss.remoting.Client.invoke(Client.java:1634)<br />at org.jboss.remoting.Client.invoke(Client.java:548)<br />at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemot<br />eInterceptor.java:62)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPr<br />opagationInterceptor.java:67)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityC<br />lientInterceptor.java:53)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.<br />java:74)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP<br />roxy.java:107)<br />at $Proxy19.createOrUpdateUser(Unknown Source)<br />at org.tolven.client.load.LoadMDBUsers.updateMDBUser(LoadMDBUsers.java:2<br />5)<br />at org.tolven.component.application.Application.updateMDBUser(Applicatio<br />n.java:152)<br />at org.tolven.component.application.Application.doStart(Application.java<br />:123)<br />at org.java.plugin.Plugin.start(Plugin.java:82)<br />at org.java.plugin.PluginManager.startPlugin(PluginManager.java:325)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:407)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:245)<br />at org.tolven.command.TolvenApplication.startRequiredPlugins(TolvenAppli<br />cation.java:87)<br />at org.tolven.command.TolvenApplication.startApplication(TolvenApplicati<br />on.java:56)<br />at org.java.plugin.boot.Boot.boot(Boot.java:346)<br />at org.java.plugin.boot.Boot.main(Boot.java:243)<br />at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:102)<br />at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemot<br />eInterceptor.java:74)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPr<br />opagationInterceptor.java:67)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityC<br />lientInterceptor.java:53)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.<br />java:74)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP<br />roxy.java:107)<br />at $Proxy19.createOrUpdateUser(Unknown Source)<br />at org.tolven.client.load.LoadMDBUsers.updateMDBUser(LoadMDBUsers.java:2<br />5)<br />at org.tolven.component.application.Application.updateMDBUser(Applicatio<br />n.java:152)<br />at org.tolven.component.application.Application.doStart(Application.java<br />:123)<br />at org.java.plugin.Plugin.start(Plugin.java:82)<br />at org.java.plugin.PluginManager.startPlugin(PluginManager.java:325)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:407)<br />at org.java.plugin.standard.StandardPluginManager.activatePlugin(Standar<br />dPluginManager.java:245)<br />at org.tolven.command.TolvenApplication.startRequiredPlugins(TolvenAppli<br />cation.java:87)<br />at org.tolven.command.TolvenApplication.startApplication(TolvenApplicati<br />on.java:56)<br />at org.java.plugin.boot.Boot.boot(Boot.java:346)<br />at org.java.plugin.boot.Boot.main(Boot.java:243)<br />at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:102)<br />Caused by: org.hibernate.exception.SQLGrammarException: could not execute query<br />at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j<br />ava:67)<br />at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp<br />er.java:43)<br />at org.hibernate.loader.Loader.doList(Loader.java:2223)<br />at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)<br />at org.hibernate.loader.Loader.list(Loader.java:2099)<br />at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)<br />at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja<br />va:338)<br />at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java<br />:172)<br />at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)<br />at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)<br />at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)<br />at org.tolven.security.bean.LoginBean.findUser(LoginBean.java:73)<br />at org.tolven.security.bean.LoginBean.createOrUpdateUser(LoginBean.java:<br />314)<br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br />java:39)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces<br />sorImpl.java:25)<br />at java.lang.reflect.Method.invoke(Method.java:597)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:112)<br />at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo<br />ntextImpl.java:166)<br />at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int<br />erceptorsInterceptor.java:63)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok<br />e(TransactionScopedEntityManagerInterceptor.java:54)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI<br />nterceptor.java:47)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)<br />at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java<br />:195)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt<br />erceptor.java:86)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles<br />sInstanceInterceptor.java:62)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(R<br />oleBasedAuthorizationInterceptor.java:166)<br />at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(Role<br />BasedAuthorizationInterceptor.java:115)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic<br />ationInterceptor.java:77)<br />at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth<br />enticationInterceptor.java:110)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce<br />ptor.java:46)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono<br />usInterceptor.java:106)<br />at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.<br />java:101)<br />at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo<br />ntainer.java:304)<br />at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)<br />at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem<br />otingInvocationHandler.java:82)<br />at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)<br />at org.jboss.remoting.transport.socket.ServerThread.processInvocation(Se<br />rverThread.java:573)<br />at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.j<br />ava:373)<br />at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.jav<br />a:166)<br />Caused by: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected -<br />got BLOB<br /><br />at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java<br />:112)<br />at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)<br />at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)<br />at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)<br />at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.<br />java:216)<br />at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPrepare<br />dStatement.java:810)<br />at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStateme<br />nt.java:1039)<br />at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPrepa<br />redStatement.java:850)<br />at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme<br />nt.java:1134)<br />at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep<br />aredStatement.java:3339)<br />at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare<br />dStatement.java:3384)<br />at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery<br />(WrappedPreparedStatement.java:236)<br />at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:<br />186)<br />at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)<br />at org.hibernate.loader.Loader.doQuery(Loader.java:674)<br />at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo<br />ader.java:236)<br />at org.hibernate.loader.Loader.doList(Loader.java:2220)<br />... 46 more<br />Press any key to continue . . .</b></span><br /><br />And the JBoss Server logs showed:<br /><span class="code">2009-07-07 18:29:11,398 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 932, SQLState: 42000<br />2009-07-07 18:29:11,398 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00932: inconsistent datatypes: expected - got BLOB</span><br /><br />After enabling full DEBUG logging for JBoss server AND Hibernate, the problem was identified as an incorrect SQL Query (see <a href="http://devsac.blogspot.com/2009/07/ora-00932-inconsistent-datatypes.html">ORA-00932: inconsistent datatypes: expected - got BLOB</a>)!<br /><br />The basic problem was a wrong SQL query formed by Hibernate - the TOLVENUSER table has 3 columns of type BLOB and the query in question was "SELECT DISTINCT...". Whereas "DISTINCT" does not work with blob columns (in Oracle 10g anyway) and hence the oracle error: ORA_00932.<br /><br />The approach I had was to customise the offending query to simply remove "DISTINCT", especially since TOLVENUSER table already has a primary key on ID column anyway - the "DISTINCT" was hence redundant in the first place.<br />This was done by updating a single Java file, org.tolven.security.bean.LoginBean (under TolvenEJB module). In the findUser( String principal) method, find the following line and remove "DISTINCT":<br />String select = "SELECT DISTINCT u FROM TolvenUser u WHERE u.ldapUID = :principal " +<br /><br />I then updated this compiled class file direclty into the tolvenEJB.jar file in JBoss's tolven ear file (at "...tolven-jboss-4.2.2.GA\server\tolven\deploy\tolven.ear/tolvenEJB.jar") and restarted Jboss.<br /><br />And it was smooth running all the way after that (configPhase3 and so on). I'm accessing all Tolven web app pages perfectly now.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com2tag:blogger.com,1999:blog-2525462180566728820.post-65871865974356483122009-07-14T16:57:00.010+05:302009-07-31T00:38:47.559+05:30ORA-00932: inconsistent datatypes: expected - got BLOB"ORA-00932: inconsistent datatypes: expected - got BLOB"<br />This weird single-line error in JBoss's console/log made no sense at all until I added the following snippet in the server's log4j.xml to enable Hibernate logging (thanks to Joe at the <a href="http://sourceforge.net/forum/forum.php?thread_id=3256807&forum_id=585637">Tolven Forum</a>):<br /><category name="org.hibernate.SQL"><br /><priority value="DEBUG"/><br /></category><br /><br />(Also of course modified the server logging threshold to DEBUG)<br /><br />And then came this stacktrace:<br /><br /><span class="code-large">2009-07-13 18:27:47,322 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [<span style="font-weight: bold; " >select distinct tolvenuser0_.id as id27_, tolvenuser0_.ldapUID as ldapUID27_, tolvenuser0_.lastLogin as lastLogin27_, tolvenuser0_.creation as creation27_, tolvenuser0_.status as status27_, tolvenuser0_.sponsorship_id as sponsor19_27_, tolvenuser0_.timeZone as timeZone27_, tolvenuser0_.locale as locale27_, tolvenuser0_.emailFormat as emailFor8_27_, tolvenuser0_.demoUser as demoUser27_, tolvenuser0_.likeness_id as likeness18_27_, tolvenuser0_.pbeKeyAlgorithm as pbeKeyA10_27_, tolvenuser0_.salt as salt27_, tolvenuser0_.iterationCount as iterati12_27_, tolvenuser0_.encodedEncryptedPrivateKeyInfo as encoded13_27_, tolvenuser0_.PRIVATE_KEY_SIZE as PRIVATE14_27_, tolvenuser0_.PRIVATE_KEY_ALGORITHM as PRIVATE15_27_, tolvenuser0_.x509EncodedKeySpec as x16_27_, tolvenuser0_.PUBLIC_KEY_ALGORITHM as PUBLIC17_27_ from tolven.TolvenUser tolvenuser0_ where tolvenuser0_.ldapUID=? and (tolvenuser0_.status='ACTIVE' or tolvenuser0_.status='active' or tolvenuser0_.status='new' or tolvenuser0_.status='ACTIVATING' or tolvenuser0_.status='')</span>]<br />java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got BLOB<br /><br /> at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)<br /> at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)<br /> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)<br /> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)<br /> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)<br /> at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)<br /> at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)<br /> at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)<br /> at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)<br /> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)<br /> at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)<br /> at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)<br /> at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)<br /> at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)<br /> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)<br /> at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)<br /> at org.hibernate.loader.Loader.doQuery(Loader.java:674)<br /> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)<br /> at org.hibernate.loader.Loader.doList(Loader.java:2220)<br /> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)<br /> at org.hibernate.loader.Loader.list(Loader.java:2099)<br /> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)<br /> at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)<br /> at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)<br /> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)<br /> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)<br /> at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)<br /> at org.tolven.security.bean.LoginBean.findUser(LoginBean.java:73)<br /> at org.tolven.security.bean.LoginBean.createOrUpdateUser(LoginBean.java:314)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at java.lang.reflect.Method.invoke(Method.java:597)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)<br /> at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)<br /> at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)<br /> at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:86)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)<br /> at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)<br /> at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)<br /> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br /> at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)<br /> at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)<br /> at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)<br /> at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)<br /> at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)<br /> at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)<br /> at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)<br />2009-07-13 18:27:47,338 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 932, SQLState: 42000<br />2009-07-13 18:27:47,338 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00932: inconsistent datatypes: expected - got BLOB</span><br /><br />Once the erring query was out in the open (in bold above), I tried executing it in an SQL window and identified that the error was being thrown on those columns of this table that were of type BLOB.<br />And Google quickly told me that Oracle doesn't like using "SELECT DISTINCT..." on any BLOB columns of a table. Voila!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-59006859997546017362009-06-24T20:59:00.023+05:302021-09-10T05:33:34.169+05:30VB Macro for deleting or detecting duplicate Outlook MailsThere are so many times that one cant help but wonder at how in spite of all the advances in comfort etc etc, life seems a lot harder than ever... sighhh.<br /><br />For example, all the haphazard shifting around at office over the last 3 years has resulted in me accumulating a mountain of disorganised backups. Most notable are the outlook backups in PST formats (what are .pst files? They are Outlooks default backup file format extension). I was getting fed-up of helplessly grinding my teeth because of all the duplicate emails in different folders and different PSTs...<br />..especially when the solution was right in front of my eyes - A simple VB macro!<br /><br />Finally I took time out to get it done and with a very polished form too as can be seen below screnshots.<br />To make it easy to carry around, I've stored it as an Excel file.<br /><br /><!--<a href="http://groups.google.com/group/attachments4myblog/web/DuplicateMailsMarker.xls">Download</a>--><a href="https://sites.google.com/site/devsacattachments/DuplicateAndMissingMailsMarker.xls?attredirects=0">Download</a> my file or scroll down further to see code to customize.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitV_-D7ePQQp2IjfdzBvTbnuJAMDomStj7t3-i_g3kEDsGuceZairLzpBd4JmY4Z4W0Hup2kaMeEm6PjipkHf5uWWqhyg3QIdEYzEnG0gJxkvAc65uAiZOGyz1oQ77TLg-fR99sS8hLRP3/s1600-h/ExcelLauncher.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 301px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitV_-D7ePQQp2IjfdzBvTbnuJAMDomStj7t3-i_g3kEDsGuceZairLzpBd4JmY4Z4W0Hup2kaMeEm6PjipkHf5uWWqhyg3QIdEYzEnG0gJxkvAc65uAiZOGyz1oQ77TLg-fR99sS8hLRP3/s320/ExcelLauncher.jpg" alt="" id="BLOGGER_PHOTO_ID_5350919531609114258" border="0" /></a><span style="font-size:85%;">Excel file containing the macro.</span><br /><br /></div><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQVyLeARNol9mSeSd9pV-8jXYuyOlsYs9KOk-EquOs6kb7nC4dodQ9EuSleOrT32_6N9ypAwI7wMEDQsJCHeP7ahQpxFq0xf4npxajw1xWujo4s5kpun04lNK4_z_sTHEKQwVSV8JFTm6V/s1600-h/ActualAppForm.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 301px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQVyLeARNol9mSeSd9pV-8jXYuyOlsYs9KOk-EquOs6kb7nC4dodQ9EuSleOrT32_6N9ypAwI7wMEDQsJCHeP7ahQpxFq0xf4npxajw1xWujo4s5kpun04lNK4_z_sTHEKQwVSV8JFTm6V/s320/ActualAppForm.jpg" alt="" id="BLOGGER_PHOTO_ID_5350919526927200914" border="0" /></a><span style="font-size:85%;">The launched macro!</span><span style="font-size:78%;"><br /></span></div><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu__w9b1H8ozqxa2pTaHz5SpMOasjyYJDeQwAqskJofaAItXBQMspSxmB0ua1qpIVDubow3aENWIMWlhiNwuHvEEnyJrhqGwcB3rP1-H1qHAJ7n3HBnS8zZ71h9O9XY-ct2CCC-xU55cav/s1600-h/AppInAction.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 294px; height: 303px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu__w9b1H8ozqxa2pTaHz5SpMOasjyYJDeQwAqskJofaAItXBQMspSxmB0ua1qpIVDubow3aENWIMWlhiNwuHvEEnyJrhqGwcB3rP1-H1qHAJ7n3HBnS8zZ71h9O9XY-ct2CCC-xU55cav/s320/AppInAction.jpg" alt="" id="BLOGGER_PHOTO_ID_5350925695689330914" border="0" /></a><span style="font-size:85%;">App in action!</span><br /></div><span style="font-weight: bold;font-size:100%;" >Functionality</span><br />The Macro identifies any duplicate items in 2 outlook folders (even those in different PST files) and optionally marks those items.<br /><br />It does this by simply comparing all the mails (or any Outlook item) in the 2 locations specified and marks the duplicate mails (in both the folders) with a tag of your choice on the Categories attribute of that email. So it only <span style="font-weight: bold;">marks </span>duplicate mails and does not do the actual deleting (those who want to automate this step can easily add an extra line in the code to delete instead of mark, but I found it too risky). An option is available to disable even the marking so that you only get the duplicate count in the summary.<br /><br /><span style="font-weight: bold;">Inputs</span><br />The actual program inputs are the names of the Outlook PST file and the mail folder of the 2 locations. Of course, if you want to compare 2 folders in the same PST, just provide the same PST name in both sets and choose the different folders.<br />The other input is the name of the label you want to apply against the Categories attribute for duplicate e-mails.<br />Finally, there is an option to enable marking of duplicate items.<br /><br /><span style="font-weight: bold;">Steps</span><br />Ensure Outlook is running before launching the macro or it will not be able to get the PSTs files loaded in Outlook.<br />1) Start the Macro.<br />2) The macro fetches the PST files loaded in your Outlook application and displays the form.<br />3) Select the PST file in set1. The set1 list gets updated with the folders in this PST file. Select the first folder you need to compare.<br />4) Similarly, select the PST file in set2. The set2 folder list gets updated with the selected PST file contents. Select the second folder you need to compare here.<br />5) Next choose whether to Mark the Duplicates or simply show a summary of duplicate sets.<br />6) Ok Button gets enabled when all the right options are selected.<br />7) Click on the OK button to start the process! This indexing step of the process may take time for large number of items... a progress bar displays the progress as well as a status bar with basic updates. When the process is done, the status shows the Completed message (and other statistics if you scroll up).<br />8) Manual step of actual deleting duplicate mails: After running the program, you have to open the Outlook folder that you want to clean up and sort by the Categories column to see those marked in Duplicate like below (the Categories column is hidden by default - this has to be added from the Field Chooser dialog box):<br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_d4HFQ5VEkR7Nmm2pnOrCgiEWLAw_xLc-MTv7Rxnglmya37ZQ-OL9yVhFBExqkOELoKR2ju33WkjUZtoY1G4NIqok3xcuVvKfdknkLQrzJ8uNGpjJI0RUcs2qTExZ8nqFrTpzoc3Q5NM0/s1600-h/MarkedMailsResults.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 224px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_d4HFQ5VEkR7Nmm2pnOrCgiEWLAw_xLc-MTv7Rxnglmya37ZQ-OL9yVhFBExqkOELoKR2ju33WkjUZtoY1G4NIqok3xcuVvKfdknkLQrzJ8uNGpjJI0RUcs2qTExZ8nqFrTpzoc3Q5NM0/s320/MarkedMailsResults.jpg" alt="" id="BLOGGER_PHOTO_ID_5350927132433866978" border="0" /></a><span style="font-size:85%;">Results showing marked mails under attribute, "Categories"</span><br /></div><br />You can give a quick look to make sure they are really duplicates. Then you simply shift-select those mails and delete! :)<br /><br /><span style="font-weight: bold;">Performance</span><br />Efficiency was increased by indexing the 2 folders before identifying duplicates- for 3000 + 1000 emails in the 2 folders, without indexing it took a few hours and still didnt finish (because there would be 3000 * 1000 reading of outlook items)! Now it runs in 5 mins.<br /><br /><span style="font-weight: bold;">Customisation</span><br />The current macro only compares the Subject and Creation Date of 2 emails to identify if they are the same (which is actually fairly safe). If you want, you can have more precision by editing the code to check more mail attributes.<br />Also as mentioned before it is simple to change the code to delete duplicate mails instead of just marking them.<br /><br />I made the macro portable by embedding it in an Excel document with a launcher button (what you see in the background of the first 2 screens above). The Excel document containing all the code is available <a href="https://sites.google.com/site/devsacattachments/DuplicateAndMissingMailsMarker.xls?attredirects=0">here</a>. Of course, you can also create the macro right into your Outlook client itself (you'll have to copy the code manually from the Excel-macro code page to your Outlook-macro code page).<br /><br />Below is the core code which is called from the form:<br /><br /><!--<span style=";font-family:courier new;font-size:78%;">--><br /><span class="code-large" style="heigha30em">Const PST1_NAME = "NewBackup"<br />Const PST2_NAME = "NewBackup"<br />Const FOLDER1_NAME = "Inbox"<br />Const FOLDER2_NAME = "OldInbox"<br />Const CATEGORY_SEPERATOR = ","<br />Const FINAL_PROGRESS_ALLOCATED = 20 ' between 1 and 100<br /><br />Public progressValue 'this holds the percentage completed.<br />Public progressStatus 'this holds the current status.<br /><br />' sample with hardcoded psts & folders<br />Private Sub markDuplicateEmails()<br />markDuplicates PST1_NAME & SEPERATOR & FOLDER1_NAME, PST2_NAME & SEPERATOR & FOLDER2_NAME, DEFAULT_CATEGORY<br />End Sub<br /><br />' actual method which takes dynamic pst\folder source and destination<br />Public Sub markDuplicates(source, destination, category)<br />Dim myOlApp, myNameSpace<br />Set myOlApp = CreateObject("Outlook.Application")<br />Set myNameSpace = myOlApp.GetNamespace("MAPI")<br /><br />Dim tmpArray, pst1Name, pst2Name, folder1Name, folder2Name<br />tmpArray = Split(source, SEPERATOR)<br />pst1Name = tmpArray(0)<br />folder1Name = tmpArray(1)<br />tmpArray = Split(destination, SEPERATOR)<br />pst2Name = tmpArray(0)<br />folder2Name = tmpArray(1)<br /><br />Dim folder1Size, folder2Size<br />folder1Size = myNameSpace.Folders(pst1Name).Folders(folder1Name).Items.Count<br />folder2Size = myNameSpace.Folders(pst2Name).Folders(folder2Name).Items.Count<br /><br />Dim array1() As cstData, array2() As cstData<br />ReDim array1(folder1Size)<br />ReDim array2(folder2Size)<br /><br />Dim outlookItem1, outlookItem2, i, j<br />Dim theCstmData As Module1.cstData<br />Dim startTime, endTime<br /><br />'populate array1<br />i = -1<br />startTime = Now<br />progressStatus = "Indexing set1..."<br />For Each outlookItem1 In myNameSpace.Folders(pst1Name).Folders(folder1Name).Items<br />i = i + 1<br />Set theCstmData.item = outlookItem1<br />theCstmData.subject = outlookItem1.subject<br />theCstmData.creationTime = outlookItem1.creationTime<br />array1(i) = theCstmData<br />progressValue = 100 * (i / (folder1Size + folder2Size + (folder1Size + folder2Size) * (FINAL_PROGRESS_ALLOCATED / 100)))<br />DoEvents<br />Next outlookItem1<br />progressStatus = "Indexing set1 Complete."<br />' populate array2<br />i = -1<br />progressStatus = "Indexing set2..."<br />For Each outlookItem2 In myNameSpace.Folders(pst2Name).Folders(folder2Name).Items<br />i = i + 1<br />Set theCstmData.item = outlookItem2<br />theCstmData.subject = outlookItem2.subject<br />theCstmData.creationTime = outlookItem2.creationTime<br />array2(i) = theCstmData<br />progressValue = 100 * ((folder1Size + i) / (folder1Size + folder2Size + (folder1Size + folder2Size) * (FINAL_PROGRESS_ALLOCATED / 100)))<br />DoEvents<br />Next outlookItem2<br />progressStatus = "Indexing set2 Complete."<br />progressStatus = "Indexing time: " & (Now - startTime) * 60 * 60 * 24<br /><br />'loop through each item in array1<br />progressStatus = "Applying Category labels on duplicates..."<br />For i = 0 To folder1Size - 1<br />'loop through each item in array 2 comparing each array2Item with current array1item<br />For j = 0 To folder2Size - 1<br />' if it is a match mark the item in array2 as duplicate<br />If array1(i).subject = array2(j).subject And _<br />array1(i).creationTime = array2(j).creationTime Then<br />If array1(i).item.Categories = "" Then<br />array1(i).item.Categories = category<br />Else<br />array1(i).item.Categories = array2(j).item.Categories & CATEGORY_SEPERATOR & category<br />End If<br />array1(i).item.Save<br /><br />If array2(j).item.Categories = "" Then<br />array2(j).item.Categories = category<br />Else<br />array2(j).item.Categories = array2(j).item.Categories & CATEGORY_SEPERATOR & category<br />End If<br />array2(j).item.Categories = category<br />array2(j).item.Save<br />End If<br />DoEvents<br />Next j<br />progressValue = (100 - FINAL_PROGRESS_ALLOCATED) + (FINAL_PROGRESS_ALLOCATED * (i / folder1Size))<br />Next i<br />progressStatus = "Total Time: " & (Now - startTime) * 60 * 60 * 24<br />progressStatus = "All done."<br />End Sub</span><br /><br /><span style="font-style: italic;">Update [25-Jun-09]:<br />New features<br />- Option to only count duplicates instead of Marking.<br />- Now displays even sub-folders recursively<br />- 2 new status views available to display number of items in selected folder.<br />- Other performance enhancements<br />See screenshot below:</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0NKq7XC4LEqyygcUnQprqV1P4Iio8ysN_hqruRzhZceFMW5-D87W6Q635qzkUiB_8UdhlcWOaTs1vV8sx5-Cw3Qo2IHrmtqQmJS_qFbdwIwIKYKHDb4ROMuD84o4FQoWeDxj1uxKb-3-q/s1600-h/NewVersion.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 269px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0NKq7XC4LEqyygcUnQprqV1P4Iio8ysN_hqruRzhZceFMW5-D87W6Q635qzkUiB_8UdhlcWOaTs1vV8sx5-Cw3Qo2IHrmtqQmJS_qFbdwIwIKYKHDb4ROMuD84o4FQoWeDxj1uxKb-3-q/s320/NewVersion.jpg" alt="" id="BLOGGER_PHOTO_ID_5351254383961600098" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUlFPjPtMcpWTyKQR7ia5Uc9N612uFRAY3GuiXhlRZ4fSaiw0wf_ndRKl64cNlOZBU0AxXrEaBYFl_1IqvRzicm3sov6_XOB_eY6QS1ejfAABvxntlrRUhxOysgtwqRCepR3wytOYld2Bs/s1600-h/NewVersionb.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 269px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUlFPjPtMcpWTyKQR7ia5Uc9N612uFRAY3GuiXhlRZ4fSaiw0wf_ndRKl64cNlOZBU0AxXrEaBYFl_1IqvRzicm3sov6_XOB_eY6QS1ejfAABvxntlrRUhxOysgtwqRCepR3wytOYld2Bs/s320/NewVersionb.jpg" alt="" id="BLOGGER_PHOTO_ID_5351255581540749154" border="0" /></a><span style="font-style: italic;">Update [03-Jul-09]:<br />New features<br />-support for choosing same folder in set1 and set2. This will mark/count duplicate sets of mails in the same folder.<br /><br />Update [15-Feb-12]:<br />New features<br />-Support for identifying Missing mails - choose source and destination folders, and all mails missing in destination will be identified.<br />-Support for marking labels as well as just counting Duplicates or Missing mails<br /></span><br /><br /><span style="font-size:85%;">Note: This was tested on Outlook 2003 but should work on any outlook...</span>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com37tag:blogger.com,1999:blog-2525462180566728820.post-71417726851185262492009-06-18T15:34:00.011+05:302010-10-31T02:10:48.971+05:30The Little Guide of IT Jargons and AcronymsHere's an age-old problem perhaps much before the time Pythogaras stated to a non-mathematical audence: "The square of the hypotinuse..."<br /><br />See most of us techies are really proud of the way we can rattle of so many tech terms and especially acronyms. Unfortunately, a sentence like that would just go right over a non-techie client or a new team member. What makes things worse is that requirement and document acronyms often vary from company to company.<br /><br />Of course there are people who use them a lot to show off... and its the general opinion of the other crows that lots of jargon/acronyms implies you are loud-mouthed and/or not really knowledgeable. I absolutely agree when I hear Sales people at Mutual Funds talking about CAMS (of course I do catch them red handed if its a computer shop salesperson!).<br /><br />Unfortunately a lot of the times, we techies are simply unaware when we're doing it! Perhaps what we could do is distribute a common acronym list before a client meeting? Something like below... of course the list would grow (or shrink?) based on client feedback after every meeting.<br /><br /><span style="font-size:78%;">I would keep updating as the list would be obviously too large to put up at one go!</span><br /><span style="font-weight: bold;">The Little Guide of IT Acronyms</span>:<br /><span style="font-weight: bold;">Tech Acronyms</span><br />BPM - Business Process Mangement<br />EDI - Electronic Data Interchange<br />ETL - Extract, Transform, Load<br />JSeam - JBoss Seam<br />RIA - Rich Internet Application<br />SaaS - Software as a Service<br />SOA - Service Oriented Archiecture<br />SOBA - Service Oriented Business Application<br />XSD - Xml Schema Definition<br />WSDL - Web Service Definition Language<br /><br /><span style="font-weight: bold;">Doc acronyms</span><br />CDS/FDS/TDS - Component/Functional/Technical Design Specification<br />Specs - Requirement Specifications<br />SSRS - Sub-System Requirements Specification<br />UTP - Unit Test Plan<br />UTR - Unit Test Results<br /><br /><span style="font-weight: bold;">Other</span><br />UIT/UAT - User Integration/Acceptance TestingSachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-7653205546215847512009-05-23T17:31:00.002+05:302009-10-23T15:22:03.074+05:30Must have tools for KubuntuCCD2ISO<br />Converts most CloneCD image file (.ccd) to standard ISO image. Only iso images can be mounted in linux.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-83654839289975811492009-05-23T17:30:00.002+05:302009-10-23T15:20:45.744+05:30Some useful one-off commands in KubuntuThis post will be regularly updated with commands as I come across them...<br /><br />Mounting an iso image<br />1) First create the location where you want the mount to be made:<br />mkdir /MyISOMount1<br /><br />2) Mount the iso:<br />sudo mount -t iso9660 CoolStuff.iso /MyISOMount1 -o loop<br />where CoolStuff.iso is the image and /MyISOMount1 is the location where the image is to be mounted.<br /><br />3) When you're all done, simpy unmount:<br />sudo umount /MyISOMount1Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-50553400631577272922009-05-11T00:52:00.003+05:302009-05-19T14:10:04.470+05:30Hardware Monitor for KubuntuOne thing I missed in my "new" old linux system is a hardware monitor tool to pick up the temperature, fan speed and any other statistics available directly from my hardware... in windows, there were so many to pick from and plenty of reviews and articles. I was surprised such a tool was not bundled with the Kubuntu Installation and nor did any turn up in the Add/Remove App.<br /><br />The good news is that it is available for linux but is not as simple as install and run as in most stuff in linux. In fact, the hardware monitoring is actually present in the default installation of Kubuntu 8.04 through the <span style="font-weight: bold;">lm-sensors</span> package (verify this is already installed from Adept or Synaptic manager and install this if not present).<br /><br />However lm-sensors has no UI. Presenting a choice of 2 UI tools, <span style="font-weight: bold;">K-Sensors</span> and <span style="font-weight: bold;">Kima</span>, to fill in this gap.<br /><br />Note: lm-sensors is not a driver package - it will simply use drivers already installed by Kububtu. This works fine for most desktops but in the case of laptops, chances are slim that kubuntu drivers will be present for hardware monitoring. So lm-sensors wont help.<br /><br />But before you use these UI tools, you need to setup your system by doing the following:<br />1) Open a terminal (simply open Konsole in Kubuntu).<br /><br />2) Next, you need to run a program from lm-sensors package to detect and list all your hardware that has sensors.<br />Run the following command and hit Enter (yes) to all the subsequent prompts except the last one, <span style="font-size:85%;"><span style="font-family: courier new;">"Do you want to add these lines automatically?"</span></span> (unless you really want to)<br /><span style="font-size:85%;"><span style="font-family: courier new;">sudo sensors-detect</span></span><br /><br />This program will show at the end a summary of all the hardware modules that needs to be added for monitoring<br />Something like:<br /><span style="font-family: courier new;">#----cut here----</span><br /><span style="font-family: courier new;"># Chip drivers</span><br /><span style="font-family: courier new;">it87</span><br /><span style="font-family: courier new;">coretemp</span><br /><span style="font-family: courier new;">#----cut here----</span><br /><br />Note: If you get a message like "no sensors detected", this most probably means none of your hardware have sensors or your kubuntu drivers are not able to detect them<br /><br />3) Next you need to include the linux kernel modules detected by running the modprobe command for each of the modules between "cut here"<br />So for the example above, type and run each of the following (normally you need to prepend with "sudo" to run in admin mode):<br />sudo modprobe it87<br />sudo modprobe coretemp<br /><br />That's it. Now you can install (do it from Adept or Synaptic of course) and run your selected UI tool.<br /><br />Ksensors can be started normally from the KDE start menu. You'll need to go to it's options menu and add the neccessary sensors you want to monitor.<br /><br />Kima will not be present in the start menu as it is actually a Kicker applet. To start Kima, right click your bottom panel, select add Applet to panel and select Kima from the list. Kima will run as an applet in Kicker. Again you would need to go to it's conigure menu and add the sensors you want to monitor.<br /><br />Finally, verify that the values you see in the sensor are accurate as they may be garbled by a factor or 2 sometimes (actual Sensor readings are usually accessible in your system bios).Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com1tag:blogger.com,1999:blog-2525462180566728820.post-87615212959688629022009-04-27T19:47:00.011+05:302009-10-23T15:18:32.251+05:30Checkstyle Bug - "Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'DUSException'".(?) and SolutionWas in the code review phase last week... time for checkstyle, findbugs n PMD to come out!<br /><br />Since it was a new project, with a little tinkering of a half-working Hudson ant script someone was working on, I could generate my Review reports. My checkstyle task was like below:<br /><span class="code"><target name = "checkstyle"><br /><mkdir dir="${checkstyle.report}"/><br /><taskdef resource="checkstyletask.properties" classpath ="${checkstyle.home}/checkstyle-all-4.4.jar;${checkstyle.home}/checkstyle-optional-4.4.jar" /><br /><checkstyle config="${basedir}\..\settings\CheckstyleSettings.xml" failonviolation="false"><br /> <fileset dir="${src.java.dir}" includes="**/*.java"/><br /> <formatter type="xml" toFile="${checkstyle.report}\checkstyle_errors.xml"/><br /></checkstyle><br /><br /><style in="${checkstyle.report}\checkstyle_errors.xml" out="${checkstyle.report}\checkstyle_report.html"<br />style="${basedir}\..\settings\checkstyle.xsl"/><br /></target><br /></span><br />Unfortunately, the Checkstyle Reports kept giving a strange Error in some classes:<br /><span class="code">"Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'DUSException'." at Line 0.</span><br />Classes which had this error would have no other Errors although the Warnings were not affected.<br /><br />However, in my Eclipse editor with Checksyle Plugin and the same Checkstyle settings, I would get normal Checkstyle Errors and Warnings without thie Error.<br /><br />Clearly, this was some Checkstyle runtime error and not an error in my class which resulted in Checkstyle failing to process that class for Errors.<br /><br />Searched the net and came up with lots of explanations / bug accusations that made a lot of sense but no easy solution... Checkstyle was somehow missing out the DUSException class when it was encountered in a throws tag of a methods Javadoc.<br /><br />So i decided to manually add my source class files to the classpath... and it worked!<br /><span class="code"><checkstyle config="${basedir}\..\settings\CheckstyleSettings.xml" failonviolation="false"><br /><span style="font-weight: bold;"> <classpath></span><br /><span style="font-weight: bold;"> <path location="${classes.dir}" /></span><br /><span style="font-weight: bold;"> <path refid="code-lib-classpath" /></span><br /><span style="font-weight: bold;"> </classpath></span><br /> <fileset dir="${src.java.dir}" includes="**/*.java"/><br /> <formatter type="xml" toFile="${checkstyle.report}\checkstyle_errors.xml"/><br /> </checkstyle><br /></span><br />Unfortunately, the Checkstyle report started showing the real CS Errors and they doubled! :) But the team could finally tackle 'em bugs before they slipped to the next phase...<br /><br /><br />Strange thing was that most of the (new) team was also getting the same Checkstyle Bug in Eclipse... which was what made me assume that it really was a CS Bug.<br />Until I had a look at their CS preferences and found that they were applying CS on .java files only. Once it was changed to apply to all files, the issue was resolved in their Eclipse as wellSachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com4tag:blogger.com,1999:blog-2525462180566728820.post-48857718852982926792009-02-26T13:26:00.005+05:302010-10-12T23:43:45.041+05:30Uploading apps onto GoogleAppEngine behind a proxyWas stuck for a while trying to upload my google app from the latest Google App Engine 1.1.9 - what should have been an instant upload turned out to be an all-day adventure because of the complication of behind a proxy that required user/password authentication...<br /><br />But finally got it to work with the following steps (from a Win XP machine using Python v2.6.1)!<br /><br />1) Install the Python patch 1424152 from http://bugs.python.org/issue1424152. They only have diff files there - so for those who don't know how to apply diff patches, I have attached the 2 PATCHED files (urllib2.py & httplib.py) for Python 2.6.1. Just replace your corresponding files in your Python26\Lib folder with these (<span style="font-weight: bold;">WARNING</span> - these files were patched specifically for Python 2.6.1. For any other Python version, you have to patch your appropriate file from the patch link above).<br /><br />2) Download the latest ntlmaps proxy (v0.9.9?) from http://ntlmaps.sourceforge.net/<br />(its only 71kb!).<br />Change the following attributes in server.cfg: PARENT_PROXY, NT_DOMAIN, USER, PASSWORD.<br />You can leave the password empty and it will prompt you when you start ntlmaps.<br /><br />3) Set the following environment values:<br />set HTTP_PROXY=localhost:5865<br />set HTTPS_PROXY=localhost:5865<br />(5685 is the default port used by ntlsmaps which can be changed in server.cfg)<br /><br />4) Start up the ntlsmaps proxy by running runserver.bat (you might have to edit the<br />bat file to point to your actual python executable).<br /><br />5) Test whether ntlsmaps is working by changing your browser proxy to point to<br />localhost:5865, and try to access some sites. If this fails, your proxy is probably<br />not understood by ntlsmaps or vice versa - try to finetune ntlsmaps some more.<br /><br />6) Finally run your upload command:<br />appcfg.py update xyz/<br />Hopefully you should get something like this:<br />...\appcfg.py:40: DeprecationWarning: the sha<br />module is deprecated; use the hashlib module instead<br />DIR_PATH,<br />Scanning files on local disk.<br />Initiating update.<br />Email: xyz@gmail.com<br />Password for xyz@gmail.com:<br />Cloning 2 static files.<br />Cloning 5 application files.<br />Deploying new version.<br />Checking if new version is ready to serve.<br />Will check again in 1 seconds.<br />Checking if new version is ready to serve.<br />Closing update: new version is ready to start serving.<br />Uploading index definitions.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0tag:blogger.com,1999:blog-2525462180566728820.post-43132333703969678832009-02-24T13:22:00.014+05:302010-10-10T23:36:57.081+05:30Error reading from file ... .msi Verify that the file exists and that you can access itGot a confounding error that occurred when trying to install an msi file on windows XP:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTx4RPnm57GIjtWlxZWmrg-UE-Dw1eqhpGdkQExn6UZ-1Cg0kmT0r70thaHRq3FAiZTPEjcrqNJFvNKhOzbL7vl4qDC9hq9tu8T-XHW7F-xwAaGZ-UuAVIbxwGBI_PcHoFs5SfQJ4PVrEm/s1600-h/ErrorReadingFromFile.jpg"><img alt="Error reading from file D:\GoogleAppEngine_1.1.9.msi. Verify that the file exists and that you can access it." style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 366px; height: 165px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTx4RPnm57GIjtWlxZWmrg-UE-Dw1eqhpGdkQExn6UZ-1Cg0kmT0r70thaHRq3FAiZTPEjcrqNJFvNKhOzbL7vl4qDC9hq9tu8T-XHW7F-xwAaGZ-UuAVIbxwGBI_PcHoFs5SfQJ4PVrEm/s400/ErrorReadingFromFile.jpg" alt="" id="BLOGGER_PHOTO_ID_5306279641000548706" border="0" /></a><span style="font-size:78%;">(Error reading from file ... .msi<br />Verify that the file exists and that you can access it.)</span><br /><br />After quite a bit of hair-pulling, I realised this was happening because I had removed Security rights to all users except myself for this folder... including the System group!<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoTVGLjqqGgmmP6XA7suF2x6lBD23JXyaDUyueMDiaEQwR-WnR5c3LJZvaaSqowb72pk67fDW7e37L-gWctFpC-bJ17QrSmqL9tfi5oGbrzDRXEpHIbVcTmSrRFcEV_6VSK9wwRua7Q85q/s1600-h/Security1.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 310px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoTVGLjqqGgmmP6XA7suF2x6lBD23JXyaDUyueMDiaEQwR-WnR5c3LJZvaaSqowb72pk67fDW7e37L-gWctFpC-bJ17QrSmqL9tfi5oGbrzDRXEpHIbVcTmSrRFcEV_6VSK9wwRua7Q85q/s400/Security1.jpg" alt="" id="BLOGGER_PHOTO_ID_5306281865912404018" border="0" /></a><br />I suppose since the System is what performs actions on msi to unpack it, etc, it needs rights here.<br />So all I had to do was to put the msi file in a folder that has System rights.<br /><br />In this case, I simply enabled access for System group to the directory and the problem was solved.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXMubhhE1voH7UaMBzCpT3XqiKfk0CM840Y5Z7OTSBoLPcrhMvi7dgpe-3Qrgmi1ZlBc1ReCyvtkX6Nou71NmeVElWhjIRasa0c6rWQ8uvZTWx04TzFS1KvbgzBT-gIPQgbWvX5jBnXjKi/s1600-h/Security2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 213px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXMubhhE1voH7UaMBzCpT3XqiKfk0CM840Y5Z7OTSBoLPcrhMvi7dgpe-3Qrgmi1ZlBc1ReCyvtkX6Nou71NmeVElWhjIRasa0c6rWQ8uvZTWx04TzFS1KvbgzBT-gIPQgbWvX5jBnXjKi/s400/Security2.jpg" alt="" id="BLOGGER_PHOTO_ID_5306282681157858802" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSIb8nfvw7a25Yq5BiL0zx88VlkOUS2smAEhn47xYgtDMATpKQcjPX2mDZeBNRSDRwWGmWki5zEwVOUZni-poJjNcGVNeZa4kz7V6XTE3fHfkTfUtklEYQ9EG70cdB2_TlFvXNZqtBNvqB/s1600-h/Security3.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 239px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSIb8nfvw7a25Yq5BiL0zx88VlkOUS2smAEhn47xYgtDMATpKQcjPX2mDZeBNRSDRwWGmWki5zEwVOUZni-poJjNcGVNeZa4kz7V6XTE3fHfkTfUtklEYQ9EG70cdB2_TlFvXNZqtBNvqB/s400/Security3.jpg" alt="" id="BLOGGER_PHOTO_ID_5306273408225428258" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIUtJDzyf9fF4cp1TPFuOfbGEOAIam7AK97GPwjMuKuL2xd3YFglYZth-A44HOOGvOaLoJpL5AyZj-36rkOVbw83nBEDz-VaGgRJS1Zej6C3BKwZCIrcr6LPRIr2WU-l99R4M6aMqrfpLH/s1600-h/Security4.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 213px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIUtJDzyf9fF4cp1TPFuOfbGEOAIam7AK97GPwjMuKuL2xd3YFglYZth-A44HOOGvOaLoJpL5AyZj-36rkOVbw83nBEDz-VaGgRJS1Zej6C3BKwZCIrcr6LPRIr2WU-l99R4M6aMqrfpLH/s400/Security4.jpg" alt="" id="BLOGGER_PHOTO_ID_5306282682720566514" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp61sJ3ePUveWWyUZJTcVjvlwkTiZ8aAnnHDhAyAxfbjUn2teJ1XARROMXvYxaysHx4DC2pGL8S90LScgVJlGBlAMmclDxF5rPefToLqWCiWCVZsBZc8UP48TOe2q1Y75XEqa7DMwHRaNz/s1600-h/Security5.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 310px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp61sJ3ePUveWWyUZJTcVjvlwkTiZ8aAnnHDhAyAxfbjUn2teJ1XARROMXvYxaysHx4DC2pGL8S90LScgVJlGBlAMmclDxF5rPefToLqWCiWCVZsBZc8UP48TOe2q1Y75XEqa7DMwHRaNz/s400/Security5.jpg" alt="" id="BLOGGER_PHOTO_ID_5306276566830701202" border="0" /></a>Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com31tag:blogger.com,1999:blog-2525462180566728820.post-62610220739931266542009-02-20T20:08:00.019+05:302009-05-25T01:23:59.733+05:30Dynamic Label Cloud GadgetWas looking for a label cloud widget for the blog but was surprised to see no one had come up with any dynamic cloud generator... was a matter of merging a little unused math with simple javascript and the Dynamic Cloud Generator gadget was born.<br /><br />If you're happy with the gadget (or even particularly upset!), for any feedback, queries or bugs do make a post in Google's gadget directory for this gadget <a href="http://www.google.com/ig/directory?type=gadgets&url=hosting.gmodules.com/ig/gadgets/file/103680291001692068835/SG_CloudFormer.xml">here</a>.<br />When posting problems, provide as much information like the Gadget properties, what browser the problem is seen, etc.<br /><br /><span style="font-weight: bold;font-size:130%;" >Gadget Properties:</span><br /><span style="font-weight: bold;">Cloud Label Max Font Size</span><br />eg: 25<br />Provide the font size for the biggest (most occurring) label.<br /><br /><span style="font-weight: bold;">Cloud Label Min Font Size</span><br />eg: 8<br />Provide the font size for the smallest (least occurring) label.<br /><br /><span style="font-weight: bold;">Cloud Background Colour</span><br />eg: red, #aabbdd<br />Change this from the default value of '#FFFFFF' (white) if you want another background colour.<br /><br /><span style="font-weight: bold;">Cloud Link Colour</span><br />This is for choosing the colour of the cloud links.<br /><br /><span style="font-weight: bold;">Base Url For Label link</span> (change this)<br />eg: http://devsac.blogspot.com/search/label<br />This is the URL for creating the links that appear on each of the labels in the label cloud - the URL is simply prepended to the Label tag. If the user clicks on the tag "Cool", the URL in this case would be http://devsac.blogspot.com/search/label/Cool<br /><br /><span style="font-weight: bold;">Feed URL to retrieve Labels from</span> (change this)<br />eg: http://devsac.blogspot.com/feeds/posts/default<br />You can simply give your blog's Blogger RSS Atom feed (in this case, you can skip the below Label Element and Attribute properties). If you don't have a Blogger atom feed or have a non-standard xml file containing your labels, then provide that URL.<br /><br /><span style="font-weight: bold;">Name of Label Element in Feed URL</span><br />eg: category<br />Leave this with default value as "category", if you provided a Blogger Atom RSS feed for above Feed URL property.<br />Otherwise, provide the name of the element that contains the labels in your xml.<br /><br /><span style="font-weight: bold;">Name of Label Attribute in Feed URL</span><br />eg: term<br />Leave this with default value as "term", if you provided a Blogger Atom feed for above Feed URL property.<br />Otherwise, provide the name of the attribute containing the labels in your xml.<br /><br /><span style="font-weight: bold;">Ignore Label Attribute in Feed URL</span><br />Leave this as default unchecked if you provided a Blogger RSS Atom feed for above Feed URL property.<br />Enable this if you are provided a Feed URL that stores the the Label as a value in the Label Element and not in an attribute (such as the RSS feed from Feedster).<br /><br /><span style="font-weight: bold;">Minimum Label Occurences</span><br />This is an optional property which will be skipped if it has default value of 0.<br />This can be used when only those labels that occur more than a minimum count need to be displayed in the cloud.<br />For e.g.:, if you want to consider only labels that have occurred more than once, then give 2 for this property.<br /><br /><span style="font-weight: bold;">Maximum Label Occurences</span><br />This is an optional property which will be skipped if it has default value of 0.<br />This can be used when only those labels that occur less than a maximum count need to be displayed in the cloud.<br />For e.g.:, if you want to consider only labels that have occurred less than 100 times, then give 99 for this property.<br /><p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrFxo_rdWjRtkNaGsc-Gw-CBvADVoVdbeGExDWSknFEtzmXwXl6N5F4FuzpMaN_13uIYAhlAvaoU9lyPnqjKBkgoAF-SrE6gyV5F80InQVXxYfQSbjzVpSywQmAaTdNe8f7k-DCoj8RvHz/s1600-h/TagCloud.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 280px; height: 176px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrFxo_rdWjRtkNaGsc-Gw-CBvADVoVdbeGExDWSknFEtzmXwXl6N5F4FuzpMaN_13uIYAhlAvaoU9lyPnqjKBkgoAF-SrE6gyV5F80InQVXxYfQSbjzVpSywQmAaTdNe8f7k-DCoj8RvHz/s400/TagCloud.JPG" alt="" id="BLOGGER_PHOTO_ID_5305987571371301954" border="0" /></a></p><br />Updates:<br /><span style="font-size:85%;"><span style="font-weight: bold;">v0.008 [25-May-09]:</span><br /></span><span style="font-size:85%;">Added new properties, min and max label occurrences for </span><span style="font-size:85%;">feature request from Randi Helene Tillung.</span><span style="font-size:85%;"><br /><span style="font-weight: bold;">v0.007</span><br />Fixed bug that left out border of gadget when setting background colour, Raised by Eemil.<br /><span style="font-weight: bold;">v0.006</span><br />Fix for bug in "Ignore Label Attribute" option.<br /><span style="font-weight: bold;">v0.005</span><br />Added </span><span style="font-size:85%;">"Ignore Label Attribute" option for those who have non-Blogger rss feeds like Feedster RSS.<br /></span><br /><br />Properties, etc can be viewed at <a href="http://www.gmodules.com/ig/creator?url=http://hosting.gmodules.com/ig/gadgets/file/103680291001692068835/SG_CloudFormer.xml&up_MAX_CLOUD_TAG_SIZE=25&up_MIN_CLOUD_TAG_SIZE=8&up_LABEL_BASE_URL=http%3A%2F%2Fdevsac.blogspot.com%2Fsearch%2Flabel&up_FEED_URL=http%3A%2F%2Fdevsac.blogspot.com%2Ffeeds%2Fposts%2Fdefault&synd=open&w=320&h=200&title=SG+Dynamic+Label+Cloud+Former&border=%23ffffff%7C3px%2C1px+solid+%23999999">this Google page</a>.Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com32tag:blogger.com,1999:blog-2525462180566728820.post-52479020649504151062008-12-16T00:58:00.003+05:302009-10-23T15:06:42.834+05:30Connecting to the Internet with Reliance NetConnect USB Modem in Kubuntu Hardy 8.04These steps are for Huawei EC325 CDMA modem on Kubuntu Hardy but the same steps could work to install any modem on any linux system (provided the generic driver matches)...<br /><br />1) Hardware setup<br />Plug-in your reliance modem into any usb port and start up your computer (or reboot into Kubuntu if it was running when you plugged it in).<br />Ensure that you see the flashing light on the reliance modem which indicates that the modem at least the usb port you selected is not disabled and that it has range.<br /><br /><br />2) Identifying modem device<br />The default installation of Kubuntu Hardy already has the neccessary drivers for Reliance Netconnect EC325. All that needs to be done is to find out the device name that the OS uses to refer to the modem. Usually this is something like ttyUSB0.<br />A simple way to find out is to look in the OS bootup logs Use the following command at the command prompt which filters out to only the few lines mentioning modem / USB:<br />dmesg | grep modem | grep USB<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYZmXh2X61pdDjcemfl3YA7KK0uJX91-mWP4ecfk3Yb4FRhm94kZ6OBRclHepGfoXHKYsHtcDZCFishasy_bpSlwrjWM8AJtTAn4oeCk0xp3kyLLR5GmchCvRlouE4ZhqJfU88f8tVpRFi/s1600-h/dmesg.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 276px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYZmXh2X61pdDjcemfl3YA7KK0uJX91-mWP4ecfk3Yb4FRhm94kZ6OBRclHepGfoXHKYsHtcDZCFishasy_bpSlwrjWM8AJtTAn4oeCk0xp3kyLLR5GmchCvRlouE4ZhqJfU88f8tVpRFi/s400/dmesg.jpg" alt="" id="BLOGGER_PHOTO_ID_5284926021364175314" border="0" /></a><br /><br />3) KPP Setup<br />To connect to the net, use the standard software, KPPP, to connect to the Internet. Start up this program from Internet->KPPP.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmRsrq9d1B7gv1iu8ma-Fya9olWUr18aYTJJWBEZ3DnsVN48w00JMP6CrwYYNckn9REFm5f27mQzac2THYYk0EQqb_Qn6M-6HKFqUuBdimY_b_R-xyKcjKInOWbv17Fu68MOmn0gwx767g/s1600-h/kppp1.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 178px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmRsrq9d1B7gv1iu8ma-Fya9olWUr18aYTJJWBEZ3DnsVN48w00JMP6CrwYYNckn9REFm5f27mQzac2THYYk0EQqb_Qn6M-6HKFqUuBdimY_b_R-xyKcjKInOWbv17Fu68MOmn0gwx767g/s400/kppp1.jpg" alt="" id="BLOGGER_PHOTO_ID_5284926023314997554" border="0" /></a><br /><br />Click on configure to launch the KPPP Configuration window.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRrDhSah5iXZHhKgTcM-vIpQaKHinMmgFiayEbzBua2_X4K67Rwd46Douxv3Oe5GkZ8uccR_GosJbwfJ9UpkvQjYbhdIgAS8kx0zwF2JUbmm_hsatlSX0aCYl8pJIaGbIVPI1J5So2x1J/s1600-h/kppp2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 323px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRrDhSah5iXZHhKgTcM-vIpQaKHinMmgFiayEbzBua2_X4K67Rwd46Douxv3Oe5GkZ8uccR_GosJbwfJ9UpkvQjYbhdIgAS8kx0zwF2JUbmm_hsatlSX0aCYl8pJIaGbIVPI1J5So2x1J/s400/kppp2.jpg" alt="" id="BLOGGER_PHOTO_ID_5284926022247967170" border="0" /></a><br /><br />In the Accounts tab of the KPPP Configuration window, click on New... -> Manual Setup.<br />Give the connection a name, like Reliance.<br />Add the phone number to dial as #777 .<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiB6oTgpZdl7gwXc5MdJvAddgj7-Oq6QuSdWLAL38aW_E5iPX_Z_RgU1QGMR_Ua8CXvmr1Gaa9CyETjjMz_9cxUBZdBc7kgMtPpSzSnqeUQbP6fP7A_cER48WbW4oA_hOv__-1dS_ytVIU/s1600-h/kppp3.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 397px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiB6oTgpZdl7gwXc5MdJvAddgj7-Oq6QuSdWLAL38aW_E5iPX_Z_RgU1QGMR_Ua8CXvmr1Gaa9CyETjjMz_9cxUBZdBc7kgMtPpSzSnqeUQbP6fP7A_cER48WbW4oA_hOv__-1dS_ytVIU/s400/kppp3.jpg" alt="" id="BLOGGER_PHOTO_ID_5284926031904752386" border="0" /></a><br /><br />Leave everything else as default values and press Ok.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcbuNZ94Ut401nDhBqG3kU1orTTvC5nEXrfLtrS2KASI3vkpLV4rB_MeGepug1CuooHXrVmIYyETPuJv1vxIN8zZ_vyFMoA6jkdzxoxGRnkyS5h7mC4NdtrVqcMZF_NDgvydlFkUUUjbTx/s1600-h/kppp4.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 323px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcbuNZ94Ut401nDhBqG3kU1orTTvC5nEXrfLtrS2KASI3vkpLV4rB_MeGepug1CuooHXrVmIYyETPuJv1vxIN8zZ_vyFMoA6jkdzxoxGRnkyS5h7mC4NdtrVqcMZF_NDgvydlFkUUUjbTx/s400/kppp4.jpg" alt="" id="BLOGGER_PHOTO_ID_5284926036624194786" border="0" /></a><br /><br />Now in the Modems tab of the KPPP Configuration window, click on New...<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5NhfKE2cK3ef9NUIgZvoCMriBbIiVxInGm33TbWFW_iEFqgB7U6ktfgriBlEMbfizO8U5WU3l460NCZmA2ZtM8jH7n7irjcFfWuSOs9pymXNhnzS6bipufnwXC39Uvz8eW_psTDOvEW6X/s1600-h/kppp5.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 323px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5NhfKE2cK3ef9NUIgZvoCMriBbIiVxInGm33TbWFW_iEFqgB7U6ktfgriBlEMbfizO8U5WU3l460NCZmA2ZtM8jH7n7irjcFfWuSOs9pymXNhnzS6bipufnwXC39Uvz8eW_psTDOvEW6X/s400/kppp5.jpg" alt="" id="BLOGGER_PHOTO_ID_5284928908034629074" border="0" /></a><br /><br />Give your modem a name like HuaweiEC325.<br />For Modem device, using the value identified in step2, look through the drop-down list and select the entry /dev/xxxx (eg: /dev/ttyUSB0).<br />Leave everything else as default values and press Ok.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghXX81tXJXwZ8N2uhW_77ntOXVH4LiiCtKXc2p7Y66_QmyVkxWrwPUQRAvCLAaJH-7x-XbrgyXtmn46kUsP4DX6-hyRKH9hpgUeVXo2z6SjPGhsFlShNfnU2IelUnY3TCzjBZgAiqxN4U/s1600-h/kppp6.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 348px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghXX81tXJXwZ8N2uhW_77ntOXVH4LiiCtKXc2p7Y66_QmyVkxWrwPUQRAvCLAaJH-7x-XbrgyXtmn46kUsP4DX6-hyRKH9hpgUeVXo2z6SjPGhsFlShNfnU2IelUnY3TCzjBZgAiqxN4U/s400/kppp6.jpg" alt="" id="BLOGGER_PHOTO_ID_5284928911289116034" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNs-lapQnwIzI4Z5qtU3EKHYrmKaJaXuJo8spaWcNUCvSTBMv3D_nNjOvm__JYtTyE2jng2AhXBwT6tp7wsoIqEOZZUn6yXPWd07u-WzX1nwXNJxB3wxGDaeiMw45iyLUrBJQn7gmVR8j7/s1600-h/kppp7.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 348px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNs-lapQnwIzI4Z5qtU3EKHYrmKaJaXuJo8spaWcNUCvSTBMv3D_nNjOvm__JYtTyE2jng2AhXBwT6tp7wsoIqEOZZUn6yXPWd07u-WzX1nwXNJxB3wxGDaeiMw45iyLUrBJQn7gmVR8j7/s400/kppp7.jpg" alt="" id="BLOGGER_PHOTO_ID_5284928914395960290" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEganuP7Kz91Q_nK2ZjdBYi5OkLUPUJVXujKPEU0axau_pxKCjgwGvEoIFghU60r7dwyp6Nz4oJ8wL9wou3KyYCXglrrGGCO-Eu9vDY5pwcU4jWTWYaanid6yPYQe5u_0PmLmvvmwIutT-Vq/s1600-h/kppp8.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 366px; height: 148px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEganuP7Kz91Q_nK2ZjdBYi5OkLUPUJVXujKPEU0axau_pxKCjgwGvEoIFghU60r7dwyp6Nz4oJ8wL9wou3KyYCXglrrGGCO-Eu9vDY5pwcU4jWTWYaanid6yPYQe5u_0PmLmvvmwIutT-Vq/s400/kppp8.jpg" alt="" id="BLOGGER_PHOTO_ID_5284928924552539122" border="0" /></a><br /><br />Press Ok again to leave the KPPP Configuration window.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2fvEoHd4eIBMOLtM6q51RO8FcAKGEiXqfS33uO6Y9gQyCAW7lIPuEhH6G-RrFVkt1KihVNgx5mDtPeGm72nZBuXjYo09DNziy1lKF4QWXhwEv0AievgtDK4XNbOrM6L-cT8yBFkLFVrQV/s1600-h/kppp9.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 316px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2fvEoHd4eIBMOLtM6q51RO8FcAKGEiXqfS33uO6Y9gQyCAW7lIPuEhH6G-RrFVkt1KihVNgx5mDtPeGm72nZBuXjYo09DNziy1lKF4QWXhwEv0AievgtDK4XNbOrM6L-cT8yBFkLFVrQV/s400/kppp9.jpg" alt="" id="BLOGGER_PHOTO_ID_5284928925886039026" border="0" /></a><br /><br />Finally, back in the KPPP main window, select the newly created Account from the Connect to drop-down list. Enter your netconnect mobile number in the Login ID and Password fields.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0VQJRTyZKD7xeI81yPW0YBinQFS9ge_wp6u0oP8Wl-qNgl0YvlVcqmzpDDkkP8b8Lf8amf7wlokmF_CuLYWYerH_eQJHebmJU2QCk3gLKVGH7IPYcrZtVYIVRQ4incjc_IWycrK_yQ_zt/s1600-h/kppp10.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 166px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0VQJRTyZKD7xeI81yPW0YBinQFS9ge_wp6u0oP8Wl-qNgl0YvlVcqmzpDDkkP8b8Lf8amf7wlokmF_CuLYWYerH_eQJHebmJU2QCk3gLKVGH7IPYcrZtVYIVRQ4incjc_IWycrK_yQ_zt/s400/kppp10.jpg" alt="" id="BLOGGER_PHOTO_ID_5284929080659788370" border="0" /></a><br /><br />Click Connect!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com1tag:blogger.com,1999:blog-2525462180566728820.post-87954857980305082512008-12-01T20:35:00.001+05:302009-02-27T15:08:35.398+05:30Extending GlassboxGlassbox provides method-level diagnosis but the details are limited:<br />in the Glassbox UI, only the summarized listing of operations is shown.<br /><br />However using JMX, break-up of each operation into it’s monitored nested operations and resource access if any, are displayed with average, max time and count, using Glassbox’s built-in monitors for important frameworks (includes servlets/jsp, struts, ejb calls with method name, jdbc calls with details of each prepared statement & more). So Glassbox by default would log your EJB calls, your database calls, your JSP calls, etc.<br /><br /><br />In spite of this, other details (like parameters for a request, method name in actual class used, etc) for the response to each monitored operation are recorded only if it fails some SLA. In addition, this does not anyway capture names of low-level classes or their methods.<br /><br /><br />But what if you wanted a customized Glassbox monitoring - what if you were not satisfied with just a high-level EJB call and wanted to see the actual classes and methods called?<br /><br />There are 2 ways to do this:<br />1) Using a simple run-time configuration in an xml file, and with NO CODING<br />2) Much more powerful customization if you were willing to define custom Aspects and pointcuts.<br /><br />This post will stick to the simple way using the xml file.<br />But I do want to highlight before you proceed that adding more detailed logging means more bloating of PermGen memory-usage (see here on how to increase PermGen). For example, even in Glassbox's built-in jsp monitor’s load-weaving, 1 loader is needed per Jsp, and each loader takes up 1MB.<br />Also, read this post about Glassbox setup first - see <a href="http://devsac.blogspot.com/2008/11/steps-to-configure-glassbox-for-sun-app.html">Steps to configure Glassbox for Sun App Server </a>.<br /><br />Ok let's see how to provide a detailed method level monitorining for all the classes in a package you specify.<br /><br />First, create a file aop.xml with the following content:<br /><br /><pre><aspectj><br /><weaver><br /><exclude within="org.springframework.jmx..*"/><br /><!-- don't reweave --><br /><exclude within="glassbox.inspector..*"/><br /></weaver><br /><aspects><br /><concrete-aspect name="YourMonitor2"<br />extends="glassbox.monitor.ui.TemplateOperationMonitor"><br /><pointcut name="methodSignatureControllerExecTarget"<br />expression="within(com.package.to.monitor..*)"/><br /></concrete-aspect><br /></aspects><br /></aspectj></pre><br /><br />Next place this in a META-INF folder in any of the directories existing in your classpath.<br /><br />That's it!<br />Next time you start up your server, Glassbox will monitor all the methods of all classes in the package, com.package.to.monitor!Sachinhttp://www.blogger.com/profile/07150290864964883084noreply@blogger.com0