object Utils
- Alphabetic
- By Inheritance
- Utils
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val LOG_MAX_SIZE: Int
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- lazy val canLog: Boolean
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- lazy val crtYear: Int
- returns
Lastest version for course & study plan information i.e. current year - 1
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log[T <: Throwable](err: T, additionalMsg: String = ""): Unit
Writes the
stackTrace
of the given message to the log file located atres/log/err.log
if there were no error getting/creating it.Writes the
stackTrace
of the given message to the log file located atres/log/err.log
if there were no error getting/creating it. Otherwise, do nothing.- err
Exception
to get the stackTrace from- additionalMsg
additional Message to add at the top of the stackTrace
- def log(msg: String): Unit
Writes the given message to the log file located at
res/log/err.log
if there were no error getting/creating it.Writes the given message to the log file located at
res/log/err.log
if there were no error getting/creating it. Otherwise, do nothing.- msg
Message to log
- lazy val logPath: Path
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def now(): String
Shorthand for custom datetime format
Shorthand for custom datetime format
- returns
Current DateTime timestamp
- def pathOf(path: String): Path
Wraps
Path.of(r(path))
seeUtils.r
for more infoWraps
Path.of(r(path))
seeUtils.r
for more info- path
resource to locate
- returns
valid relative to resource (relative w.r.t the runnable i.e. jar or else)
- def r(path: String): String
Resolve given 'against' resource path e.g.
Resolve given 'against' resource path e.g. if we want to acces
/files/res/md/test.md
just entermd/test.md
. And this function will return the corresponding relative path- path
resource to locate
- returns
valid relative to resource (relative w.r.t the runnable i.e. jar or else)
- def read(path: Path): String
Shorthand for
String.join("\n", Files.readAllLines(path, UTF_8))
i.e.Shorthand for
String.join("\n", Files.readAllLines(path, UTF_8))
i.e. opens, read each line into string, closes, then convert to string- path
path to file to read
- returns
content as string
- def readLines(path: Path): IndexedSeq[String]
Shorthand for
Files.readAllLines(path, UTF_8).asScala.toIndexedSeq
i.e.Shorthand for
Files.readAllLines(path, UTF_8).asScala.toIndexedSeq
i.e. opens, read each line into list, closes- path
path to file to read
- returns
content as
IndexedSeq
(immutable)
- def sanitize(str: String): String
Removes special characters and other that can prevent text from displaying / being read/written properly
Removes special characters and other that can prevent text from displaying / being read/written properly
- str
sring to sanitize
- returns
sanitized string
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryOrElse[T](resolver: () => T, defaultVal: () => T, additionalMsg: String = "", logErr: Boolean = true): T
Try to apply given function
resolver
if it succeeds => return the result, or if an exception happened => returndefaultVal
Try to apply given function
resolver
if it succeeds => return the result, or if an exception happened => returndefaultVal
- defaultVal
function that returns a default value when an exception happened
- additionalMsg
additional Message to add at the top of the stackTrace
- logErr
whether to log the error (NB: it's important to pass in a function otherwise the default value will be computed when this method is called)
- returns
see above
- def tryOrElse[T](resolver: () => T, defaultVal: T, additionalMsg: String, logErr: Boolean): T
Try to apply given function
resolver
if it succeeds => return the result, or if an exception happened => returndefaultVal
Try to apply given function
resolver
if it succeeds => return the result, or if an exception happened => returndefaultVal
- defaultVal
value to return when an exception happened
- additionalMsg
additional Message to add at the top of the stackTrace
- logErr
whether to log the error
- returns
see above
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def write(path: Path, content: String, append: Boolean = false): Path
Write string using
Files.writeString
method (i.e.Write string using
Files.writeString
method (i.e. to write multiple strings do not use this method multiple times)- path
Path of file to write to
- content
content to write to file
- append
whether to add to previous content or overwrite the file
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated