private string FetchIdFromExtendedAttribute(ISyncEvent e) {
IFileSystemInfo path = null;
if (e is FileEvent) {
path = (e as FileEvent).LocalFile;
} else if (e is CrawlRequestEvent) {
path = (e as CrawlRequestEvent).LocalFolder;
} else if (e is FolderEvent) {
path = (e as FolderEvent).LocalFolder;
}
if (path != null && path.Exists) {
Guid? uuid = null;
try {
uuid = path.Uuid;
} catch (ExtendedAttributeException ex) {
Logger.Debug("Could not read extended attributes from path, do not fetch", ex);
}
if (uuid != null) {
var mappedObject = this.storage.GetObjectByGuid((Guid)uuid);
if (mappedObject != null) {
return mappedObject.RemoteObjectId;
} else {
Logger.Debug("Uuid found in Extended Attribute but not in DataBase, do not fetch");
}
}
}
return null;
}
}