Java Servlet to Write to a temporary file

/**
* Write to a temporary file
* @author Sanjeev Kulkarni
* @since 0.5 - 18-Nov-2009 3:23:35 PM
* @version 0.1
*/

package com.ack.web.servlet;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WriteToATemporaryFile extends HttpServlet {

public void doGet( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException {
// get the web applications temporary directory
File tempDir = (File) getServletContext().
getAttribute( "javax.servlet.context.tempdir" );

// create a temporary file in that directory
File tempFile = File.createTempFile( getServletName(), ".tmp", tempDir );

// write to file
FileWriter fw = new FileWriter( tempFile );
try {
fw.write( "done and dusted" );
}
finally {
fw.close();
}

// tell servlet client where to look for file
res.getWriter().println( "check file: " + tempFile.getAbsolutePath() );
}

}

Happy Deepavali

Diwali or Deepaavali means an Array of Lamps i.e .Rows of diyas (Deep = Lamp, Vali =Array)

Of all the festivals celebrated in India, Diwali is by far the most glamorous and important. Enthusiastically enjoyed by people of every religion, its magical and radiant touch creates an atmosphere of joy and festivity.

As a family festival, it is celebrated 20 days after Dussehra, on the 13th day of the dark fortnight of the month of Ashwin (October / November).


It is a festival of lights symbolizing the victory of righteousness and the lifting of spiritual darkness. It celebrates the victory of good over evil - and the glory of light. This festival commemorates Lord Rama's return to his kingdom Ayodhya after completing his 14-year exile.

Homes are decorated, sweets are distributed by everyone and thousands of lamps lit to create a world of fantasy.

Deepaavali is a time for fun and revelry. Diwali is also a time for pooja and tradition. This Diwali festival, it is surmised dates back to that period when perhaps history was not written, and in its progress through centuries it lighted path of thousands to attain the ultimate good and complete ecstasy.

Deepavali is very enthusiastically celebrated for five continuous days and each day has its significance with a number of myths, legends and beliefs.

Jai Shri Laxshmidevi...

Happy Independence Day!!!

On Independence Day Here’s wising our dreams of a new tomorrow come true for us… NOW AND ALWAYS!!!

Take a stand against evil, corruption & terrorism 4 we belong to India, a nation of pride & we will thus say- "HINDU, MUSLIM, SIKH, ISAI, SAB HAI BHAI BHAI."
god bless all of us!!!

Happy Independence Day!!!

Orkut Scraps
Sanjeev Kulkarni

Bhuvan, (Sanskrit: भुवन, lit: Earth) launched by ISRO

ISRO launched the beta version of its web-based 3-D satellite imagery tool, Bhuvan, on August 12, 2009. Bhuvan will offer superior imagery of Indian locations compared to other Virtual Globe software with spatial resolutions ranging from 6 m to 55 m. Locations can be viewed from different perspectives and will allow for the measurement of distances. The Bhuvan portal is designed to run on slow Internet connections. The imagery would steer clear of all sensitive military installations in India for security concerns.

Bhuvan displays better images of India than the ones relayed by Google Earthweatherstates and districts, relevant only to the country. Bhuvan is equally capable of offering images of the globe, but the best resolution area includes India at the moment. In the Indian subcontinent, Bhuvan will be able to display a picture from ten meters away that is; a commuter moving on the road can be easily spotted.[5] along with a number of other interesting features which include information and even administrative boundaries of all

File:Bhuvanscreenshot.jpg

National Remote Sensing Agency played an important role in the creation of this product. ISRO has used data provided by satellites including Resourcesat-1, Cartosat-1 and Cartosat-2 to get the best possible imagery for India. ISRO claims that the application can provide imagery of up to 10 metres for major Indian cities compared to 200 meters provided by Google Earth.

Google launches a major offensive against Microsoft

The clash between Microsoft and Google has turned more intense. First, Google announced its first operating system, Chrome. Then Microsoft announced the new version of Office with major cloud applications support. To increase its presence in the search engine market, Microsoft recently announced its deal to take over Yahoo's search business. Now, Google has announced the launch of its new promotional campaign called 'Going Google.'



The main target of 'Going Google' campaign is to topple Microsoft's hold in office applications. Google will soon launch a series of advertisements which will boast why some 3,000 organizations are signing up to use Google applications each day. Google claims that so far over 1.75 million businesses, schools and organizations have signed up to use the various combinations of Gmail, Google Calendar, Google Docs and the other Google apps. Currently, Microsoft Office has the highest market share for office related applications. Google is trying to be proactive in telling people why its solution is better than Microsoft Office.

Google will be heavily investing in the 'Going Google' campaign and it plans to advertise through billboards on four major U.S. highways that will give a new message about Google apps everyday for a month. The billboards will be placed on the 101 in San Francisco, the West Side Highway in New York, the Ike in Chicago, and Mass Pike in Boston.

Google is also attempting to use Twitter platform to spread the 'Going Google' message. At the bottom of its blog post on the matter, Google urges people who use its apps to 'Tweet your story' and provides a link to auto-populate a tweet with the #gonegoogle hashtag. You can also follow the GoogleAtWork Twitter account to follow the Gone Google stories.

Google also plans to use 'Spread the Word' campaign, which will be similar to Mozilla's campaign to promote Firefox. Google will also try to use the conventional way of sending fliers and pre-populated emails to promote its 'Going Google' campaign.

Yeah the world is looking for big war between Google and Microsoft.Thing is that Microsoft never gives any thing free so it's not giving much benefit to normal end user as opposed to Google.Google gives free many of their products.What could have happened if Google has established their company before Microsoft? I guess we would never heard the name Microsoft by then! My appreciate Google and Microsoft for all their innovations in the IT field.Lets see what happens in the future.Who will the battle? My well wishes are with Google, and I also pray Microsoft to innovate and give a damn fight.