* @return the absolutePath method off of the
* file object
*/
public static String pathForResourceNamed(String fileName, String frameworkName, NSArray<String> languages) {
String path = null;
NSBundle bundle = "app".equals(frameworkName) ? NSBundle.mainBundle() : NSBundle.bundleForName(frameworkName);
if(bundle != null && bundle.isJar()) {
log.warn("Can't get path when run as jar: " + frameworkName + " - " + fileName);
} else {
WOApplication application = WOApplication.application();
if (application != null) {
URL url = application.resourceManager().pathURLForResourceNamed(fileName, frameworkName, languages);
if(url != null) {
path = url.getFile();
}
} else if( bundle != null ) {
URL url = bundle.pathURLForResourcePath(fileName);
if(url != null) {
path = url.getFile();
}
}
}