Class Common
java.lang.Object
fr.ens.biologie.genomique.eoulsan.Common
This class define common constants.
- Since:
- 1.0
- Author:
- Laurent Jourdren
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidPrint error message to the user and exits the application.static voidPrint error message to the user and exits the application.static voidPrint error message to the user and halts the application.static voidPrint error message to the user and halts the application.static voidexit(int exitCode) Exit the application.static intgetThreadsNumber(int localThreads, int maxLocalThreads) Get the number of threads to use from localThreads, maxLocalThreads and global threads number.static voidhalt(int exitCode) Exit the application.static voidprintWarning(String message) Print warning.static voidSend email.static voidshowAndLogErrorMessage(String message) Show and log an error message.static voidshowErrorMessageAndExit(String message) Show a message and then exit.static voidshowMessageAndExit(String message) Show a message and then exit.static voidWrite log data.static voidwriteLog(OutputStream os, long startTime, String data) Write log data.
-
Method Details
-
writeLog
Write log data.- Parameters:
os- OutputStream of the log filestartTime- startTime of Eoulsandata- data to write- Throws:
IOException- if an error occurs while writing log file
-
writeLog
Write log data.- Parameters:
file- the log filestartTime- startTime of Eoulsandata- data to write- Throws:
IOException- if an error occurs while writing log file
-
showMessageAndExit
Show a message and then exit.- Parameters:
message- the message to show
-
showAndLogErrorMessage
Show and log an error message.- Parameters:
message- message to show and log
-
showErrorMessageAndExit
Show a message and then exit.- Parameters:
message- the message to show
-
errorExit
Print error message to the user and exits the application.- Parameters:
e- Exceptionmessage- message to show to the use
-
errorExit
Print error message to the user and exits the application.- Parameters:
e- Exceptionmessage- message to show to the uselogMessage- true if message must be logged
-
errorHalt
Print error message to the user and halts the application.- Parameters:
e- Exceptionmessage- message to show to the use
-
errorHalt
Print error message to the user and halts the application.- Parameters:
e- Exceptionmessage- message to show to the uselogMessage- true if message must be logged
-
exit
public static void exit(int exitCode) Exit the application.- Parameters:
exitCode- exit code
-
halt
public static void halt(int exitCode) Exit the application.- Parameters:
exitCode- exit code
-
sendMail
Send email.- Parameters:
subject- email subjectmessage- message of the email
-
getThreadsNumber
public static int getThreadsNumber(int localThreads, int maxLocalThreads) Get the number of threads to use from localThreads, maxLocalThreads and global threads number.- Parameters:
localThreads- number of threadsmaxLocalThreads- maximum number of threads- Returns:
- the number of threads to use
-
printWarning
Print warning.- Parameters:
message- message to print
-