Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Reading only the last modification timestamp of an updatesite
Reading only the last modification timestamp of an updatesite [message #769337] Wed, 21 December 2011 20:47 Go to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi to all,

I want to implement a feature, which
should read the entire updatesite only, if changed until the last loading.
I've done it like this:

IMetadataRepositoryManager manager = ....
IMetadataRepository repository = manager.loadRepository(new URI(updatesiteUrl), 0, new NullProgressMonitor());
String timestamp = repository.getProperty("p2.timestamp");
    Long timestampLongSite = new Long(timestamp);


I've seen there is a property p2.timestamp, which I read. But therefore I have to read the entire site, which is often unnecessary to me. This action needs a lot of time, if I have many updatesites in scope.

Is it possible to get this property without reading the whole site and is this property always reset, if content of a site changes (even on composite-sites?) or is there another features, which can handle this?

Can you please give me a hint?

Best regards
Markus

Best regards
Re: Reading only the last modification timestamp of an updatesite [message #769687 is a reply to message #769337] Thu, 22 December 2011 14:36 Go to previous messageGo to next message
DJ Houghton is currently offline DJ HoughtonFriend
Messages: 28
Registered: July 2009
Junior Member
The IMetadataRepositoryManager#loadRepository method is spec'd that it may use a cached copy of the repository if one is available. I believe depending on the repository type, that in the code (for an HTTP accessible repository) we do a HEAD call to get the timestamp and only reload if necessary. So what you are trying to accomplish should already be working. If it isn't working for you then please enter a bug against the Equinox/p2 component along with the version of the build you are using and steps to reproduce. Thanks.
Re: Reading only the last modification timestamp of an updatesite [message #773932 is a reply to message #769687] Mon, 02 January 2012 22:48 Go to previous message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi again,

yes it is already working while my eclipse is running. But If I have to restart it, the site is read without using any cache the first time. So is there any mechanism to hold the cache longer than until the next restart of the workspace? Can I store and reload it?

Or can I determine the timestamp of last change to notice it myself?

Thanks for help

Best regards
Markus
Previous Topic:Is os.version>=10.7 legal in osgi platform filter? (repost)
Next Topic:pde build leaves temp folders when using p2.gathering
Goto Forum:
  


Current Time: Thu Apr 25 22:34:38 GMT 2024

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

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

Back to the top