FileDocCategorySizeDatePackage
MHProperties.javaAPI DocExample956Sun Mar 26 19:56:34 BST 2000None

MHProperties

public class MHProperties extends Properties
A Properties file specialized to read a UNIX user's MH Mail System profile.

Fields Summary
public static String
PROFILE_NAME
Constructors Summary
public MHProperties()


	  
		super();
		try {
			load();
		} catch (FileNotFoundException ex) {
			System.err.println("You do not appear to have a " + PROFILE_NAME);
		} catch (IOException ex) {
			System.err.println(ex);
		}
	
Methods Summary
public voidload()
Load the .mhprofile; like load(InputStream) but simpler.


		String fName = System.getProperty("user.home") +
			System.getProperty("file.separator") +
			PROFILE_NAME;
		BufferedReader is = new BufferedReader(new FileReader(fName));
		String line;
		while ((line = is.readLine()) != null) {
			if (line.startsWith("#"))
				continue;
			int where = line.indexOf(':");
			put(line.substring(0, where), line.substring(where+1).trim());
		}