Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » retrieving local history of an IFile
retrieving local history of an IFile [message #334534] Mon, 16 February 2009 16:51 Go to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060206060303020808050007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hi,

I have found a way to retrieve the history of a given IFile when its
project is connected to a VCS repository through code as :

<snip>
final IProject project = file.getProject();
final RepositoryProvider provider = RepositoryProvider.getProvider(project);
final IFileHistoryProvider historyProvider =
provider.getFileHistoryProvider();
final IFileHistory history = historyProvider.getFileHistoryFor(target,
IFileHistoryProvider.NONE, new NullProgressMonitor());
</snip>

Though try as I might, I cannot find any API way of retrieving the same
information when the project is _not_ connected to a repository. All I
found was something like

<snip>
final FileSystemManager fsm =
((org.eclipse.core.internal.resources.Workspace)workspace).g etFileSystemManager();
final HistoryStore = fsm.getStates(file.getFullPath(), new
NullProgressMonitor());
</snip>

Which leads to a fair amount of discouraged access warnings. Isn't there
any open API I'd have missed while digging through the code?

Thanks

Laurent Goubet
Obeo

--------------060206060303020808050007
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------060206060303020808050007--
Re: retrieving local history of an IFile [message #334535 is a reply to message #334534] Mon, 16 February 2009 17:30 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090600000105000505090309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Sorry, went a little overboard on that one ... my IFile was not an IFile
(IResource :p) and I was too confident in the code completion.

Laurent Goubet
Obeo

laurent Goubet a
Re: retrieving local history of an IFile [message #334773 is a reply to message #334535] Thu, 26 February 2009 18:35 Go to previous message
Zori Aldana is currently offline Zori AldanaFriend
Messages: 5
Registered: July 2009
Junior Member
Hi Laurent,

I am trying to retrieve the latest file in the local history. Did you get
it to work without accessing the internal API so that you do not get the
discourage access warnings?

I have something like:
FileSystemResourceManager fsm =
((org.eclipse.core.internal.resources.Workspace)PlusUIPlugin .getWorkspace()).getFileSystemManager();
IFileState[] fileStates =
fsm.getHistoryStore().getStates(myFile.getFullPath(),null);
InputStream is = fileStates[0].getContents(); //these are the contents I
want of the last file.

Thanks,

Zeus
Previous Topic:[Databinding] Problem with listener of AggregateValidationStatus
Next Topic:Assembly indexer in Ganymede
Goto Forum:
  


Current Time: Thu Apr 25 11:29:28 GMT 2024

Powered by FUDForum. Page generated in 0.02675 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top