In my application I need to read a .properties file from the client system , and the path of file is specified (*C:\site.properties*), for example at client system file should exist at *C:\site.properties*, after fetching the information from .properties file, I have to login to a particular site based on inforamation provided in .properties file.
I have written two custome classes, one for client and other for server,
the client site class is working fine and on server class the dispatcher
method is not working...
*Can any one help me how to solve this, OR you can give me any better
solution to read the .properties file from the client site.*
CLIENT SITE CUSTOME CLASS:-
package com.tomax.ezlube.login.client;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import com.ulcjava.base.client.UIProxy;
*public* *class* UIClientProperties *extends* UIProxy {
*protected* Object *createBasicObject*(Object[] args) {
*return* *new* Properties();
}
*protected* Properties *getBasicProperties*() {
*return* (Properties) getBasicObject();
}
*public* *void* *updateClientProperties*() {
Properties clientProperties = getBasicProperties();
*try* {
clientProperties.load(*new* FileInputStream(
"C:\\ezlube\\siteno\\siteno.properties"));
}
*catch* (IOException e) {
e.printStackTrace();
}
Object obj = clientProperties;
updateStateULC("clientProperties", obj);
}
}
--------------------------------------------------
SERVER SITE CUSTOME CLASS:-
package com.tomax.ezlube.login.server;
import java.util.Properties;
import com.ulcjava.base.application.ULCProxy;
import com.ulcjava.base.server.IDispatcher;
public *class* ULCClientProperties *extends* ULCProxy {
*private* ClientPropertiesUpdateListener fClientPropertiesUpdateListener;
*private* Properties clientProperties;
*public* Properties *getClientProperties*() {
*return* clientProperties;
}
*public* *void* *setClientProperties*(Properties clientProperties) {
*this*.clientProperties = clientProperties;
}
*protected* String *typeString*() {
*return* "com.tomax.ezlube.login.client.UIClientProperties";
}
*public* *void* *execClientProperties*() {
invokeUI("updateClientProperties");
}
*public* *void* *updateClientProperties*(Object obj) {
Properties clientProperties = (Properties) obj;
*if* (fClientPropertiesUpdateListener != *null*) {
fClientPropertiesUpdateListener.clientPropertiesUpdated(obj);
}
}
*public* *void*
*setClientPropertiesUpdateListener*(ClientPropertiesUpdateListener
listener) {
fClientPropertiesUpdateListener = listener;
}
*protected* IDispatcher *createDispatcher*() {
*return* *new* ULCClientPropertiesDispatcher();
}
*protected* *class* ULCClientPropertiesDispatcher *extends*ULCProxyDispatcher {
*public* *final* *void* *updateClientProperties*(Object obj) {
ULCClientProperties.*this*.updateClientProperties((Properties) obj);
}
}
*public* *interface* ClientPropertiesUpdateListener {
*public* *void* *clientPropertiesUpdated*(Object clientProperties);
}
}
--------------------------------------------------------------
HOW I INVOKES :_
ULCClientProperties clientProperties = *new* ULCClientProperties();
clientProperties.upload();
clientProperties.execClientProperties();
clientProperties.setClientPropertiesUpdateListener(*new*
ULCClientProperties.ClientPropertiesUpdateListener() {
*public* *void* *clientPropertiesUpdated*(Object properties) {
System.*out*.println(" ********************** INSIDE DISPATCHER " +
properties);
siteNo = ((Properties)properties).getProperty("site");
}
});
Thanks In advance
Pankaj
UIClientProperties.java
Description: Binary data
ULCClientProperties.java
Description: Binary data
