public static String readLine(String path, int lineNumber)
    {
	if(lineNumber > 0)
	{
	    //Firstly try to create the file
	    File file = new File(path);

	    //if the file exists
	    if(file.exists())
	    {
		String line = "";
		String content = "";
		int counter = 1;

		// Read the file and display it line by line. 
		BufferedReader in = null;

		try
		{
		    //open stream to file
		    in = new BufferedReader(new FileReader(file));

		    try
		    {
			while ((line = in.readLine()) != null)
			{

			    if(counter == lineNumber)
			    {
				content = line;
				break;
			    }   
			    counter++;
			}
		    }
		    catch(IOException e){ return null; }
		    finally{ in.close(); }

		    return content;
		}
		catch (FileNotFoundException e){ return null; }
		catch (IOException e){ return null; }
	    }
	    else{ return null; }
	}
	else{ return ""; }
    }