|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--server.Conf
The configuration file setup.conf is read though this class. The class contains a number of servicemethods to fetch different values through the configurationfile.
Method Summary | |
static void |
addObserver(ConfObserver co)
|
static void |
addUser(String name,
String login,
String pass)
Adds a new user to the 'Users' tag. |
static void |
banAddress(InetAddress address)
Banns an IP-address, by writing it into the configurationfile. |
static XMLTag[] |
concat(XMLTag[] newArr,
XMLTag[] oldArr)
Concatinates to arrays of XMLTags. oldArr will be first in the new array, and newArr last. |
static String[] |
getActiveCommands()
Gets all active commands. |
static String |
getCheckIniterval()
How often the server should check the clients for beeing passive |
static int |
getCommandUsage(String name)
|
static XMLTag[] |
getDirectoriesFromUser(XMLTag user)
All directories tags for a user and its usergroups. |
static XMLTag[] |
getGroups()
Looks for usergroups in 'Users.Usergroup' |
static Conf |
getInstance()
Returns a singleton of this class. |
static int |
getLineCapacity()
The maxupload of the server. |
static int |
getMaxUsers()
The maximum number of uses on the server. |
static int[] |
getPassivPorts()
The initerval of ports, that may be used by passiv filetransfer. |
static XMLTag |
getRoot()
Returns the entire "root" of the server. |
static String |
getServerIP()
The ip, that is informed the client by a 'pasv' command. |
static int |
getServerPort()
The port the server is configured to start up on. |
static int |
getSession()
Gets the sessionnumber on the server. |
static String |
getUserOption(XMLTag t,
String option)
Seeks out an users option. |
static XMLTag[] |
getUsers()
Searches for users i in both 'Users.User' and 'Users.Usergroup'. |
static boolean |
isBanned(Socket client)
Finds out if the IP, that this socket is connected to is banned. |
static boolean |
isBanned(String ipAddress)
Finds out if the IP address, that is passed is banned from this server. |
static boolean |
IsIntelligenceActive()
Is server intelligence for kicking and banning clients turned on? |
static void |
reload()
Discards the current state of the configurationfile [setup.xml], and reads the old configuration into the servers memory. |
static boolean |
removeObserver(ConfObserver co)
|
static void |
save()
Saves the configurationfiles current state onto the harddrive. |
static void |
setActiveCommands(String[] commands)
Sets the active commands. |
static void |
setCheckIniterval(String time)
Sets the how often the server should check the clients for beeing passive |
static void |
setCommandUsage(String name,
int val)
|
static void |
setIntelligenceActive(boolean active)
Sets server intelligence for kicking and banning active |
static void |
setSession(int seNr)
Sets the value in the 'Memory.sessions' |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void addObserver(ConfObserver co)
public static boolean removeObserver(ConfObserver co)
public static XMLTag getRoot()
public static String getCheckIniterval()
public static void setCheckIniterval(String time)
time
- eg. 00:05:00public static boolean IsIntelligenceActive()
public static void setIntelligenceActive(boolean active)
active
- on/offpublic static int getCommandUsage(String name) throws Exception
Exception
public static void setCommandUsage(String name, int val)
public static String[] getActiveCommands()
public static void setActiveCommands(String[] commands)
commands
- String[] {List, Retr, ect...}public static XMLTag[] getUsers()
public static XMLTag[] getGroups()
public static XMLTag[] concat(XMLTag[] newArr, XMLTag[] oldArr)
newArr
- The new array, that should be added to the old arrayoldArr
- the old array
public static void addUser(String name, String login, String pass)
name
- The users name (for reference use)login
- loginnavnpass
- passwordpublic static int getServerPort()
public static int getSession()
public static void setSession(int seNr)
seNr
- sessionnumber.public static String getServerIP()
public static int[] getPassivPorts()
public static int getMaxUsers()
public static String getUserOption(XMLTag t, String option)
t
- The users tagoption
- The option that is seeked after
public static XMLTag[] getDirectoriesFromUser(XMLTag user)
user
- the users tag
public static boolean isBanned(Socket client)
client
- Socket to client
public static boolean isBanned(String ipAddress)
ipAddress
- fx. 127.0.0.1
public static void banAddress(InetAddress address)
address
- The IP-address!public static int getLineCapacity()
public static void save()
public static void reload()
public static Conf getInstance()
|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |