@Transactional(propagation=Propagation.REQUIRED)
public void addScanDirectoryTransactional(final File directory) {
if (directory.isDirectory()) {
final String id = this.idservice.getId(directory);
if (!this.fsDao.isDirectoryPresent(id)) {
final ScanFolderDomain scanFolder = new ScanFolderDomain(id, directory, null);
final SystemDomain system = this.systemDao.getSystem(cfg.getUSN());
system.getScanFolder().add(scanFolder);
scanFolder.setSystem(system);
scanFolder.setDidlRoot(this.didl.createDidlContainer(scanFolder, system.getDidlRoot()));
this.systemDao.store(system);
logger.info("added new scan-directory : " + scanFolder.getPath());
}
}
}