commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre8rou <pierre8r-nab...@yahoo.fr>
Subject [Commons Configuration] Setting up a Java application reading a file Properties.
Date Fri, 29 Aug 2008 18:41:20 GMT

Hello,

I'd like to set up a Java application reading a file Properties.
I think achieve this by filling a class Params and OtherParams classes.
I think using Apache Commons Configuration.
How to write my file Properties?
How to read the file properties to fill  Params class and OtherParams class
?

Thanks,

Pierre8r

Here the class Params :
----------------------
 
package com.test.configuration;
 
public class Params {
	private static String directoryInput;
	private static String directoryOutput;
	private static String fileInput;
	private static String fileOutput;
	private static OtherParams otherParams1, otherParams2, otherParams3;
	
 
	public static void setDirectoryInput(String directoryInput) {
		Params.directoryInput = directoryInput;
	}
 
	public static String getDirectoryInput() {
		return directoryInput;
	}
 
	public static void setDirectoryOutput(String directoryOutput) {
		Params.directoryOutput = directoryOutput;
	}
 
	public static String getDirectoryOutput() {
		return directoryOutput;
	}
 
	public static void setFileInput(String fileInput) {
		Params.fileInput = fileInput;
	}
 
	public static String getFileInput() {
		return fileInput;
	}
 
	public static void setFileOutput(String fileOutput) {
		Params.fileOutput = fileOutput;
	}
 
	public static String getFileOutput() {
		return fileOutput;
	}
 
	public static void setOtherParams1(OtherParams otherParams1) {
		Params.otherParams1 = otherParams1;
	}
 
	public static OtherParams getOtherParams1() {
		return otherParams1;
	}
 
	public static void setOtherParams2(OtherParams otherParams2) {
		Params.otherParams2 = otherParams2;
	}
 
	public static OtherParams getOtherParams2() {
		return otherParams2;
	}
 
	public static void setOtherParams3(OtherParams otherParams3) {
		Params.otherParams3 = otherParams3;
	}
 
	public static OtherParams getOtherParams3() {
		return otherParams3;
	}
 
}
 

Here the class OtherParams :
---------------------------

 
package com.test.configuration;
 
public class OtherParams {
	private static double caract01, caract02, caract03, caract04;
 
	public static void setCaract01(double caract01) {
		OtherParams.caract01 = caract01;
	}
 
	public double getCaract01() {
		return caract01;
	}
 
	public static void setCaract02(double caract02) {
		OtherParams.caract02 = caract02;
	}
 
	public static double getCaract02() {
		return caract02;
	}
 
	public static void setCaract03(double caract03) {
		OtherParams.caract03 = caract03;
	}
 
	public static double getCaract03() {
		return caract03;
	}
 
	public static void setCaract04(double caract04) {
		OtherParams.caract04 = caract04;
	}
 
	public static double getCaract04() {
		return caract04;
	}
 
}
 




-- 
View this message in context: http://www.nabble.com/-Commons-Configuration--Setting-up-a-Java-application-reading-a-file-Properties.-tp19225015p19225015.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message