Skip to main content



      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 15:47 Go to next message
Eclipse UserFriend
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 09:36 Go to previous messageGo to next message
Eclipse UserFriend
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 17:48 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 21:00:10 EDT 2025

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

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

Back to the top