CmisSync.Lib.Consumer.SituationSolver.AbstractEnhancedSolver.WriteOrUseUuidIfSupported C# (CSharp) Method

WriteOrUseUuidIfSupported() protected method

protected WriteOrUseUuidIfSupported ( IFileSystemInfo info ) : System.Guid
info IFileSystemInfo
return System.Guid
        protected Guid WriteOrUseUuidIfSupported(IFileSystemInfo info) {
            Guid uuid = Guid.Empty;
            if (info.IsExtendedAttributeAvailable()) {
                try {
                    Guid? localUuid = info.Uuid;
                    if (localUuid == null || this.Storage.GetObjectByGuid((Guid)localUuid) != null) {
                        uuid = Guid.NewGuid();
                        try {
                            info.Uuid = uuid;
                        } catch (RestoreModificationDateException restoreException) {
                            Logger.Debug("Could not retore the last modification date of " + info.FullName, restoreException);
                        }
                    } else {
                        uuid = localUuid ?? Guid.NewGuid();
                    }
                } catch (ExtendedAttributeException ex) {
                    throw new RetryException(ex.Message, ex);
                }
            }

            return uuid;
        }