|
Package com. remote;
Import java. io. IOException;
Import java. util. Properties;
/**
* Read the value corresponding to the key in the configuration file.
* @ Author JunjieQin
*/
Public class RemoteConfigUtil {
Private String REMOTE_HOST_IP;
Private String LOGIN_ACCOUNT;
Private String LOGIN_PASSWORD;
Private String pai_doc_name;
Private String sourcePath;
Private String targetPath;
// Construction method without parameters
Public RemoteConfigUtil (){
Try {
// Read the configuration file
Properties prop = new Properties ();
Prop. load (this. getClass (). getClassLoader (). getResourceAsStream ("copyRemoteFile. properties "));
// Obtain value based on key
REMOTE_HOST_IP = prop. getProperty ("REMOTE_HOST_IP ");
LOGIN_ACCOUNT = prop. getProperty ("LOGIN_ACCOUNT ");
LOGIN_PASSWORD = prop. getProperty ("LOGIN_PASSWORD ");
Pai_doc_name = prop. getProperty ("pai_doc_name ");
SourcePath = prop. getProperty ("sourcePath ");
TargetPath = prop. getProperty ("targetPath ");
} Catch (IOException e ){
E. printStackTrace ();
}
}
Public String getLOGIN_ACCOUNT (){
Return LOGIN_ACCOUNT;
}
Public void setLOGIN_ACCOUNT (String login_account ){
LOGIN_ACCOUNT = login_account;
}
Public String getLOGIN_PASSWORD (){
Return LOGIN_PASSWORD;
}
Public void setLOGIN_PASSWORD (String login_password ){
LOGIN_PASSWORD = login_password;
}
Public String getREMOTE_HOST_IP (){
Return REMOTE_HOST_IP;
}
Public void setREMOTE_HOST_IP (String remote_host_ip ){
REMOTE_HOST_IP = remote_host_ip;
}
Public String getSHARE_DOC_NAME (){
Return pai_doc_name;
}
Public void setSHARE_DOC_NAME (String pai_doc_name ){
Pai_doc_name = pai_doc_name;
}
Public String getSourcePath (){
Return sourcePath;
}
Public void setSourcePath (String sourcePath ){
This. sourcePath = sourcePath;
}
Public String getTargetPath (){
Return targetPath;
}
Public void setTargetPath (String targetPath ){
This.tar getPath = targetPath;
}
} |