* @return The Directory created, or the one found (if it exists already).
* @see org.evolizer.model.resources.entities.fs.Directory
* @see org.evolizer.versioncontrol.svn.importer.mapper.SVNModelMapper.createDirectory
*/
private Directory internalCreateDirectory(String fullPath) {
Directory directory = fDirectories.get(fullPath);
if (directory == null) {
directory = new Directory(fullPath, null);
fCachedRoot = directory; // I cache the deepest, non saved parent.
Directory parent = null;
if (!fullPath.equals("/")) {
String parentPath = getParentDirectoryPath(fullPath);
parent = fDirectories.get(parentPath);
if (parent == null) {
parent = internalCreateDirectory(parentPath);
}
directory.setParentDirectory(parent); // SourceUnit -> Directory
parent.add(directory); // Directory -> SourceUnit
}
fDirectories.put(fullPath, directory);
LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_createdDirectory, fullPath));
}
return directory;