Skip to content
Snippets Groups Projects
Commit 7b843733 authored by SeeBasTStick's avatar SeeBasTStick
Browse files

removed dead code

parent 492e4980
No related branches found
No related tags found
Loading
...@@ -114,7 +114,7 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte ...@@ -114,7 +114,7 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte
.redirectError(ProcessBuilder.Redirect.PIPE) .redirectError(ProcessBuilder.Redirect.PIPE)
}catch (e : IllegalArgumentException){ }catch (e : IllegalArgumentException){
communicator.sendDebugMessage("illegal argument exception", MessageType.Info) communicator.sendDebugMessage("illegal argument exception ${e.cause}", MessageType.Info)
} }
return ProcessBuilder() return ProcessBuilder()
} }
...@@ -136,26 +136,20 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte ...@@ -136,26 +136,20 @@ class ProBCommandLineAccess(val communicator : CommunicatorInterface) : ProBInte
/** /**
* Executes the given command * Executes the given command
* @param command to execute * @param command to execute
* @throws CommandCouldNotBeExecutedException probcli failed to execute the given command
* @throws IOException failed to reach probcli * @throws IOException failed to reach probcli
*/ */
fun performActionOnDocument(command : ProcessBuilder) { private fun performActionOnDocument(command : ProcessBuilder) {
communicator.sendDebugMessage("execution + ${command.command()}", MessageType.Info) communicator.sendDebugMessage("execution + ${command.command()}", MessageType.Info)
val process: Process = command.start() val process: Process = command.start()
//just void error and output
val outputAsString = readFromStream(process.inputStream) readFromStream(process.inputStream)
readFromStream(process.errorStream) //just void error readFromStream(process.errorStream)
// process.waitFor() //we must wait here to ensure correct behavior when reading an error // process.waitFor() //we must wait here to ensure correct behavior when reading an error
val exitStatus = process.waitFor() val exitStatus = process.waitFor()
communicator.sendDebugMessage("exit status of execution: $exitStatus", MessageType.Info) communicator.sendDebugMessage("exit status of execution: $exitStatus", MessageType.Info)
if(!outputAsString.contains("ProB Command Line Interface")){
throw CommandCouldNotBeExecutedException("Error when trying to call probcli with command $command")
}
} }
private fun readFromStream(stream: InputStream) : String{ private fun readFromStream(stream: InputStream) : String{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment