/// <summary></summary> /// <param name="remotePath"></param> /// <param name="repoInfo"></param> public RemotePathSyncItem(string remotePath, RepoInfo repoInfo) { this.localRoot = repoInfo.TargetDirectory; this.remoteRoot = PathRepresentationConverter.LocalToRemote(repoInfo.RemotePath); this.remotePath = remotePath; if (remotePath.StartsWith(this.remoteRoot)) { this.remotePath = remotePath.Substring(this.remoteRoot.Length).TrimStart(CmisUtils.CMIS_FILE_SEPARATOR); } this.localPath = PathRepresentationConverter.RemoteToLocal(this.remotePath); }
/// <summary></summary> /// <param name="localPath"></param> /// <param name="repoInfo"></param> public LocalPathSyncItem(string localPath, RepoInfo repoInfo) { this.localRoot = repoInfo.TargetDirectory; this.remoteRoot = repoInfo.RemotePath; this.localPath = localPath; if (localPath.StartsWith(this.localRoot)) { this.localPath = localPath.Substring(localRoot.Length).TrimStart(Path.DirectorySeparatorChar); } this.remotePath = PathRepresentationConverter.LocalToRemote(this.localPath); }
/// <summary></summary> /// <param name="remoteFolder"></param> /// <param name="localRelativePath"></param> /// <param name="repoInfo"></param> public RemotePathSyncItem(string remoteFolder, string localRelativePath, RepoInfo repoInfo) { this.localRoot = repoInfo.TargetDirectory; this.remoteRoot = repoInfo.RemotePath; this.remotePath = Path.Combine(remoteFolder, PathRepresentationConverter.LocalToRemote(localRelativePath)); if (this.remotePath.StartsWith(this.remoteRoot)) { this.remotePath = this.remotePath.Substring(this.localRoot.Length).TrimStart(CmisUtils.CMIS_FILE_SEPARATOR); } string remoteRootRelative = remoteFolder; if (remoteFolder.StartsWith(this.remoteRoot)) { remoteRootRelative = remoteFolder.Substring(localRoot.Length).TrimStart(CmisUtils.CMIS_FILE_SEPARATOR); } this.localPath = Path.Combine(PathRepresentationConverter.RemoteToLocal(remoteRootRelative), localRelativePath); }