Is there a way to detect the platform (Window / Linux) in which the website is running by Groovy / Grails?
相关问题
- Grails External Configuration. Can't access to
- grails unit test + Thread
- Can I override cast operator in Groovy?
- Use Groovy to Sort XML File
- How to run python commands using groovy in Jenkins
相关文章
- Using Spring Dynamic Languages Support from Groovy
- Grails: How to make everything I create Upper Case
- Grails and Quartz: Bad value for type long
- Groovy Java 9 modules support
- Groovy: What's wrong with this “Hello World” p
- Sending JSON to javascript on GSP
- Create WS security headers for REST web service in
- Grails application is not found after updating to
or for short:
Since groovy provide a Map access to
getAt/putAt
methods.will return the name of the OS, e.g. "Windows XP". So if you want to figure out whether you're running on Windows or not, you could do something like:
Alternatively,
org.apache.commons.lang.SystemUtils
(from the Apache commons-lang project) exposes some boolean constants that provide the same information as the code above, e.g.More specific constants such as these are also available