if(applicationContext.containsBean("custom_mediaFileService")){
return (FileService)applicationContext.getBean("custom_mediaFileService");
}
DefaultFileService defaultFileService = new DefaultFileService();
String imgDir = env.getProperty("media.imageDir");
String imgBaseUrl = env.getProperty("media.imageBaseUrl", "/files/images");
imgDir = getDefaultFilePath(imgDir, imgBaseUrl);
imgDir = PathUtils.ensureEndingFileSeparator(imgDir)+"data";
defaultFileService.setBaseDir(imgDir);
defaultFileService.setBaseUrl(getWebPath(imgBaseUrl));
return defaultFileService;
}