location = UriUtils.encode(location);
Path path = descriptor.getFileSystem().provider().getPath(URI.create(descriptor.getStringRepositoryRoot() + location));
path = ioService.createDirectories(path);
String uniqueId = encodeUniqueId(path.toUri().toString());
Directory directory = new Directory(uniqueId, path.getFileName().toString(), trimLocation(path));
return directory;
}