if (files[i].isDirectory()) {
File dir = FileVersionUtil.getLatestVersionDirectory(files[i]);
if (dir != null) {
Descriptor root = DescriptorFactory.buildDescriptor(dir);
if (root != null) {
SharedLibrary sl = root.getSharedLibrary();
if (sl != null) {
try {
container.getRegistry().registerSharedLibrary(sl, dir);
} catch (Exception e) {
log.error("Failed to initialize sharted library", e);