Tp.Subversion.Subversion.Subversion.GetBinaryFileContent C# (CSharp) Method

GetBinaryFileContent() public method

public GetBinaryFileContent ( RevisionId changeset, string path ) : byte[]
changeset Tp.SourceControl.VersionControlSystem.RevisionId
path string
return byte[]
		public override byte[] GetBinaryFileContent(RevisionId changeset, string path)
		{
			try
			{
				using (var stream = GetSVNFileStream(new SvnRevisionId(changeset), path))
				{
					return stream.ToArray();
				}
			}
			catch (SvnFileSystemException ex)
			{
				throw new VersionControlException(String.Format("Subversion exception: {0}", ex.Message));
			}
		}

Usage Example

        public void GetBinaryFileContent()
        {
            using (var s = new Subversion(GetLocalRepositorySettings(), ObjectFactory.GetInstance <ICheckConnectionErrorResolver>(), ObjectFactory.GetInstance <IActivityLogger>(), ObjectFactory.GetInstance <IDiffProcessor>()))
            {
                byte[] content = s.GetBinaryFileContent(3.ToString(), "readme.txt");

                Assert.AreEqual(Encoding.UTF8.GetBytes("Test repository to verify subversion integration."), content);
            }
        }
All Usage Examples Of Tp.Subversion.Subversion.Subversion::GetBinaryFileContent