Package Torello.Java.Build
Class Util
- java.lang.Object
-
- Torello.Java.Build.Util
-
public class Util extends java.lang.Object
If you are writing a personalized instance of theFunctionalInterface
namedUpgradeProcessor
, then there is some possibility that you might need to use these two helper functions.
Hi-Lited Source-Code:- View Here: Torello/Java/Build/Util.java
- Open New Browser-Tab: Torello/Java/Build/Util.java
File Size: 2,240 Bytes Line Count: 69 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctional
Annotation may also be called 'The Spaghetti Report'.Static-Functional
classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@Stateless
Annotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 2 Method(s), 2 declared static
- 0 Field(s)
-
-
Method Summary
Error Handling Methods Modifier and Type Method static void
ERROR_EXIT(String cmd)
static void
HALT_ON_ERROR(OSResponse osr)
-
-
-
Method Detail
-
ERROR_EXIT
public static void ERROR_EXIT(java.lang.String cmd)
Simple Method for exiting with a consistent error message.
Terminates the JVM
This method invokes the Java-Command'System.exit'
- Parameters:
cmd
- The Command that was executed, leading to the error.- Code:
- Exact Method Body:
final String s = BBLUE_BKGND + ' ' + RESET + " There was an error, and build is halting: " + BRED + cmd + RESET; final int len = s.length() - (BBLUE_BKGND + RESET + BRED + RESET).length(); System.err.println( Printing.ERROR_EXIT_LINE + '\n' + s + StringParse.nChars(' ', Printing.LEN + 40 - len - 1) + BBLUE_BKGND + ' ' + RESET + '\n' + Printing.ERROR_EXIT_LINE + '\n' ); System.exit(0);
-
HALT_ON_ERROR
public static void HALT_ON_ERROR(OSResponse osr)
Checks a Command's Response for errors. If Errors have occured, the response that was returned is printed, and anError
is thrown.- Parameters:
osr
- The Command's Response- Throws:
BuildError
- If an error has occured in executing an Operating System call.- Code:
- Exact Method Body:
if ( (osr.response != 0) // NOTE: You cannot do this check, because 'gsutil' literally writes all of its // output to standard-error. It's quite madening. // || ((osr.stdErr != null) && (osr.stdErr.length() > 0)) ) { System.out.println('\n' + osr.toString() + '\n'); throw new BuildError("OSResponse Had Errors, Look at StackTrace to See Where !"); }
-
-