public static String retrieveProtdistResult(String dirName) 
            throws UnexpectedErrorEx, ErrorRetrievingJob
    {
        GetAbsolutePath pt = new GetAbsolutePath();
        String absolutePath = pt.getPath();
        String output = "";
        
        if (dirName == null || dirName.equals(""))
            throw new ErrorRetrievingJob("Job Id cannot be null..!");
        
        String outcome = CheckJobStatus.checkStatus(dirName);

        if (outcome.equalsIgnoreCase("FINISHED"))
        {
            if (dirName.contains("PhylipProtdist"))
            {
                try
                {
                    FileInputStream fstream = new FileInputStream(
                            absolutePath + dirName + "/outfile");
                    DataInputStream in = new DataInputStream(fstream);
                    BufferedReader br = new BufferedReader(new InputStreamReader(in));
                    String s;
                    while ((s = br.readLine()) != null)
                    {
                        output += s + "\n";
                    }
                    in.close();

                    return output;
                }//try 
                catch (Exception e)
                {
                    System.out.println("Exception Occurred " + e);
                    throw new UnexpectedErrorEx("The job could not be retrieved..!");
                }//catch

            }//if
            else
            {
                throw new ErrorRetrievingJob("Invalid JobId..!");
            }//else

        } 
        else if (outcome.equalsIgnoreCase("ERROR"))
        {
           throw new ErrorRetrievingJob("The job could not be retrieved..!");
        } 
        else if (outcome.equalsIgnoreCase("RUNNING"))
        {
            throw new ErrorRetrievingJob("The job is still running..!");
        }
        else
        {
            throw new UnexpectedErrorEx("Unexpected error occurred, The job could not be retrieved..!");
        }
        
    }//retrieveProtDistResult