I'm tring to obtain file path for sharepoint 2013 location without hardcoding values on code.
I found the method GetGenericSetupPath,SPUtility class, wich has a strange behaviuor:
SPUtility.GetGenericSetupPath("Template")
reuturns
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template"
on the 15 hive
inhstead
SPUtility.GetGenericSetupPath("template\\LAYOUTS")
return a path on 14 hive
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\LAYOUTS"
finally the default path seems to be hive 15:
SPUtility.GetGenericSetupPath("")
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\" string