public String writeFile(String filePath, Object[] objects, int fileType, boolean append) 
        {
		String errorMessage = null; // if unchanged, method was successfull.
		File file = new File(filePath);
		
		// write to file of type typeCode
		switch(fileType) 
                {
		case FileHandler.TEXT_FILE:
			try 
                        {
			PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(file, append)));
					
					/* Combine individual String objects into one large String.
					 * Use StringBuffer for speed
					 */
			StringBuffer sbuf = new StringBuffer();
                            for( int i=0; i<objects.length; i++)
                            {
                                sbuf.append(objects[i]).append("\n");  // String cast unnecessary due to toString()
                            }
			out.println( sbuf.toString() ); // why is toString() needed? Because println() is overloaded.
			out.close();
			} 
                        
                        catch(IOException ioe)
                        {
                            errorMessage = ioe.getMessage();
			}
				break;
			
			default:
				return "fileType flag set to non-text code. " +
					   "TextFileHandler#writeFile operation is aborted.";
		}
		return errorMessage; // if null, method was successfull.
	}