Files
gateway-mnp-dbc/dbcmnpsrc/FE/mnpdev/sim/sistemi/src/conf/FTPProperties.java
2024-05-13 12:54:14 +02:00

115 lines
2.0 KiB
Java

/*
* Created on Feb 11, 2005
*
* MNP [project sim]
* Copyright (c) 2005
*
* @author Giovanni Amici
* @version 1.0
*/
package conf;
import java.util.Properties;
/**
* @author Giovanni
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class FTPProperties {
/**
* @return Returns the hostname.
*/
public static String getHostname() {
return hostname;
}
/**
* @param hostname The hostname to set.
*/
public static void setHostname(String hostname) {
FTPProperties.hostname = hostname;
}
/**
* @return Returns the password.
*/
public static String getPassword() {
return password;
}
/**
* @param password The password to set.
*/
public static void setPassword(String password) {
FTPProperties.password = password;
}
/**
* @return Returns the username.
*/
public static String getUsername() {
return username;
}
/**
* @param username The username to set.
*/
public static void setUsername(String username) {
FTPProperties.username = username;
}
static FTPProperties _instance = null;
static private String hostname;
static private String username;
static private String password;
//private Vector _listaDirectory = new Vector();
private FTPProperties() {
try {
loadFileProperties();
//createDefaultDirectory();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
public static FTPProperties getInstance() {
if (_instance == null)
_instance = new FTPProperties();
return _instance;
}
/**
* Carica le proprietà
* @throws Exception
*/
private void loadFileProperties() throws Exception {
Properties properties = SimConfFile.getInstance().ReadSection("FTP");
setHostname(properties.getProperty("hostname"));
setUsername(properties.getProperty("username"));
setPassword(properties.getProperty("password"));
//setTxmode(properties.getProperty("txmode"));
}
}