CmisSync.Lib.Database.Database.LocalToRemote C# (CSharp) Method

LocalToRemote() public method

Return the local path of an item identified by its remote path. If no such item exist yet in database (ex: new remote file), returns the local path it should be written to.
public LocalToRemote ( string localPath, bool isFolder ) : string
localPath string
isFolder bool
return string
        public string LocalToRemote(string localPath, bool isFolder)
        {
            string normalizedLocalPath = RemoveLocalPrefix(localPath);
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("localPath", normalizedLocalPath);
            string table = isFolder ? "folders" : "files";
            string remotePath = (string)ExecuteSQLFunction("SELECT path FROM " + table + " WHERE localPath=@localPath", parameters);
            if (string.IsNullOrEmpty(remotePath))
            {
                return PathRepresentationConverter.LocalToRemote(localPath);
            }
            return remotePath;
        }