Skip to content

Commit

Permalink
documentation part 2 #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Zukkari committed Feb 25, 2018
1 parent 12ae831 commit 25dde8a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/cs/ut/engine/LogManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object LogManager {
detailedDir = DirectoryConfiguration.dirPath(Dir.DETAIL_DIR)
log.debug("Detailed log directory -> $detailedDir")

allowedExtensions = ConfigurationReader.findNode("fileUpload/extensions")!!.itemListValues()
allowedExtensions = ConfigurationReader.findNode("fileUpload/extensions").itemListValues()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/cs/ut/jobs/SimulationJob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SimulationJob(
) : Job(id) {

private var process: Process? = null
private val configNode = ConfigurationReader.findNode("userPreferences")!!
private val configNode = ConfigurationReader.findNode("userPreferences")

override fun preProcess() {
log.debug("Generating training parameters for job $this")
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/cs/ut/jobs/UserRightsJob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UserRightsJob(private val f: File) : Job() {


companion object {
private val configNode = ConfigurationReader.findNode("userPreferences")!!
private val configNode = ConfigurationReader.findNode("userPreferences")

val log = Logger.getLogger(UserRightsJob::class.java)!!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AdminViewController : SelectorComposer<Component>(), UIComponent {
@Wire
private lateinit var logData: Textbox

private val configNode = ConfigurationReader.findNode("userPreferences/adminFunctionality")!!
private val configNode = ConfigurationReader.findNode("userPreferences/adminFunctionality")

private val logFile: File = File(DirectoryConfiguration.dirPath(Dir.LOG_FILE))

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/cs/ut/ui/controllers/HeaderController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.zkoss.zkmax.zul.Navitem

class HeaderController : SelectorComposer<Component>(), Redirectable {

private val configNode = ConfigurationReader.findNode("header")!!
private val configNode = ConfigurationReader.findNode("header")

@Wire
private lateinit var navbar: Navbar
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/cs/ut/ui/controllers/Redirectable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ interface Redirectable {
}

companion object {
private val pages: List<Value> = ConfigurationReader.findNode("pages")!!.itemList()
private val pages: List<Value> = ConfigurationReader.findNode("pages").itemList()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UploadLogController : SelectorComposer<Component>(), Redirectable, UICompo

private lateinit var media: Media

private val allowedExtensions = ConfigurationReader.findNode("fileUpload/extensions")!!.itemListValues()
private val allowedExtensions = ConfigurationReader.findNode("fileUpload/extensions").itemListValues()

/**
* Method that analyzes uploaded file. Checks that the file has required extension.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ParameterModalController : GenericAutowireComposer<Component>(), Redirecta
override fun doAfterCompose(comp: Component?) {
super.doAfterCompose(comp)

cols = ConfigurationReader.findNode("csv/userCols")!!.itemListValues()
cols = ConfigurationReader.findNode("csv/userCols").itemListValues()
log.debug("Read columns from master config: $cols")

this.file = arg[FILE] as File
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/cs/ut/util/CsvReader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ class CsvReader(private val f: File) {
init {
log.debug("Initializing csv reader...")

val configNode = ConfigurationReader.findNode("csv")!!
val configNode = ConfigurationReader.findNode("csv")
splitter = configNode.valueWithIdentifier("splitter").value.toRegex()
confThreshold = configNode.valueWithIdentifier("threshold").intValue()
sampleSize = configNode.valueWithIdentifier("sampleSize").intValue()

emptyValues = ConfigurationReader.findNode("csv/empty")!!.itemListValues()
activityId = ConfigurationReader.findNode("csv/activityId")!!.itemListValues()
caseId = ConfigurationReader.findNode("csv/caseId")!!.itemListValues()
dateFormats = ConfigurationReader.findNode("csv/timestamp")!!.itemListValues().map { it.toRegex() }
resourceId = ConfigurationReader.findNode("csv/resource")!!.itemListValues()
emptyValues = ConfigurationReader.findNode("csv/empty").itemListValues()
activityId = ConfigurationReader.findNode("csv/activityId").itemListValues()
caseId = ConfigurationReader.findNode("csv/caseId").itemListValues()
dateFormats = ConfigurationReader.findNode("csv/timestamp").itemListValues().map { it.toRegex() }
resourceId = ConfigurationReader.findNode("csv/resource").itemListValues()

log.debug("Finished initializing csv reader...")
}
Expand Down

0 comments on commit 25dde8a

Please sign in to comment.