[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: RE: Re: Equality of files

From: Gonzalez Diaz, Xoan <G2485_at_caixagalicia.es>
Date: Mon, 21 Apr 2008 14:14:09 +0200

> -----Mensaje original-----
> De: Gonzalez Diaz, Xoan [mailto:G2485_at_caixagalicia.es]
> Enviado el: viernes, 18 de abril de 2008 14:24
> Para: users_at_subversion.tigris.org
> Asunto: RE: Re: Equality of files
>
> > On Friday 18 April 2008, Gonzalez Diaz, Xoan wrote:
> > > Does anyone knows how to determine programmatically if a file (in
> the
> > > repository) is the same that a previously exported one (in OS
> > > filesystem)?
> >
> > You could combine 'svn cat' with the diff program and then you'd
have
> your
> > answer. Other than that, I would take a look at keyword
substitutions
> > which
> > offer a way to embed an ID in a file, so you can always say from
which
> > branch
> > and revision a file came.
>
>
>
> Thanks for the info,
>
> But I was thinking in Javahl or SvnClientAdapter ... and I was trying
> to determine, with the help of these libraries, a way to compare
> (perhaps with a hash function or something like this) the equality of
> those two files (actually two binary files, perhaps two .jar files).
>
> I would like to pack that funcionality in a single Java method to be
> reused.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: users-help_at_subversion.tigris.org

Finally I have found a solution,

First I build an InputStream from repository Url, using getContent
function from svnClientAdapter, and another InputStream with local file.

Then, I convert these ones to byte arrays and compare byte to byte.

I suppose this is not the optimal method but it works!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-04-22 08:09:01 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.