Class GenerateINI
java.lang.Object
games.stendhal.server.core.engine.GenerateINI
generates a server.ini for Stendhal
- Author:
- hendrik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Stringprotected static Stringprotected static Stringprotected static Stringstatic StringgetStringWithDefault(BufferedReader input, String defaultValue) reads a String from the input.static StringgetStringWithoutDefault(BufferedReader input, String errorMessage) reads a String from the input.static voidgenerates a server.ini for Stendhalstatic voidgenerates a server.ini for Stendhalstatic StringuppcaseFirstLetter(String source) Makes the first letter of the source uppercase.
-
Constructor Details
-
GenerateINI
public GenerateINI()
-
-
Method Details
-
getStringWithDefault
reads a String from the input. When no String is chosen the defaultValue is used.- Parameters:
input- the buffered input, usually System.indefaultValue- if no value is written.- Returns:
- the string read or default if none was read.
-
getStringWithoutDefault
reads a String from the input. When no String is choosen the errorMessage is is displayed and the application is terminated.- Parameters:
input- the input stream, usually System.inerrorMessage- the error message to print when failing- Returns:
- string read from input
-
uppcaseFirstLetter
Makes the first letter of the source uppercase.- Parameters:
source- the string- Returns:
- *T*he string, with first letter is upper case.
-
main
generates a server.ini for Stendhal- Parameters:
args- command line parametersserverIni- name of server.ini to write- Throws:
FileNotFoundException- in case the file cannot be written
-
main
generates a server.ini for Stendhal- Parameters:
args- command line parameters- Throws:
FileNotFoundException- in case the file cannot be written
-
getDatabasePassword
-
getDatabaseUsername
-
getDatabaseHost
-
getDatabaseName
-