Can anyone tell me if there is or they have seen any example code that will delete the local cache or remove all advertisements from the cache each time a JXTA application is started?
There r two methods called flushAdvertisement(adv) and flushAdvertisements(id,type) in DiscoveryService class which u can make use of to delete advertisements.
If u want to delete all adv of particular type in local cache, go for the 2nd one where u can give a null value for id and type as DiscoveryService.Type. If u want to delete a specific adv then give its id in the 1st parameter.
Hope it helps.
Much appreciated mate.
As far as I know, deleting the cache is no more useful starting 2.5 release. It was somewhat compulsory with 2.4.x.
If you really need to, a simple delete on the corresponding cache dir BEFORE logging to the JXTA network is a way to do it.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.