Skip to content
Advertisement

Tag: scala

How to get Scala List from Java List?

I have a Java API that returns a List like: I am using the below scala code: Now if I try scala syntax sugar like: it does not work. I get the error: It seems I need to convert Java List to Scala List. How to do that in above context? Answer EDIT: Note that this is deprecated since 2.12.0.

How to check existence of a program in the path

I’m writing a program in scala which call: I want to check if “svn” is available from the commandline (ie. it is reachable in the PATH). How can I do this ? PS: My program is designed to be run on windows Answer Here’s a Java 8 solution: Replace anyMatch(…) with filter(…).findFirst() to get a fully qualified path. Here’s a

Advertisement