CmisSync.Lib.Database.Database.GetSyncItemFromLocalPath C# (CSharp) Метод

GetSyncItemFromLocalPath() публичный Метод

Gets the syncitem from local path.
public GetSyncItemFromLocalPath ( string localPath ) : SyncItem
localPath string Local path.
Результат SyncItem
        public SyncItem GetSyncItemFromLocalPath(string localPath)
        {
            string normalizedLocalPath = RemoveLocalPrefix(localPath);
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("localPath", normalizedLocalPath);

            // Try to find it in files database.
            string path = (string)ExecuteSQLFunction("SELECT path FROM files WHERE localPath=@localPath", parameters);
            if (string.IsNullOrEmpty(path))
            {
                // Try to find it in folders database.
                path = (string)ExecuteSQLFunction("SELECT path FROM folders WHERE localPath=@localPath", parameters);
                if (string.IsNullOrEmpty(path))
                {
                    return null;
                }
            }

            return SyncItemFactory.CreateFromPaths(localPathPrefix, normalizedLocalPath, remotePathPrefix, path, false);
        }