private void discoverFileResources(Service s, Map<Path, String> pathToURIPath,
Path baseUriPath,
String prefix) {
File rootDir = new File(new File(getHost().getState().resourceSandboxFileReference),
prefix);
if (!rootDir.exists()) {
log(Level.INFO, "Resource directory not found: %s", rootDir.toString());
return;
}
String basePath = baseUriPath.toString();
String serviceName = s.getClass().getSimpleName();
List<File> resources = FileUtils.findFiles(rootDir.toPath(),
new HashSet<String>(), false);
for (File f : resources) {
String subPath = f.getAbsolutePath();
subPath = subPath.substring(subPath.indexOf(serviceName));
subPath = subPath.replace(serviceName, "");
Path uriPath = Paths.get(basePath, subPath);
pathToURIPath.put(f.toPath(), uriPath.toString().replace('\\', '/'));
}
if (pathToURIPath.isEmpty()) {
log(Level.INFO, "No resources found in directory: %s", rootDir.toString());
}
}