Community
Participate
Working Groups
Here's a long story for you ... :) I discovered that trying to get the repo name using properties, does not work; it always returns null. artifactRepository.getProperty(IRepository.PROP_NAME); even if using "manager" (which some java docs implies is preferred way, if you don't want to load repository). manager.getRepositoryProperty(<locationURI>, IRepository.PROP_NAME); Even though, it works just fine to set the NAME property to change the name: artifactRepository.setProperty(IRepository.PROP_NAME, newName); So ... lo and behold, after 2 or 3 hours of debugging, I discover there is actually an API method to get the name! artifactRepository.getName() works as expected. I was "lead down the path" of using properties since there are properties for other things that my little app reads and changes, such as IRepository.PROP_MIRRORS_URL and "p2.statsURI" ... and sure seems to be documented that PROP_NAME should work ... /** * The key for a string property providing a human-readable name for the repository. * @see IRepositoryManager#getRepositoryProperty(URI, String) * @see IRepository#getProperties() */ public static final String PROP_NAME = "name"; //$NON-NLS-1$ FWIW, when I called simply "getProperties" the following properties were returned, for what I happened to have set in my repo: p2.timestamp, p2.compressed, p2.mirrorsURL, p2.statsURI I should emphasize, repo.setProperty(IRepository.PROP_NAME, newName) works just as expected. I was trying to polish my app so it would not re-write the repository if the properties I was trying to set just happened to be what they already were ... but it kept re-writing it because name property was coming back null. Luckily, I could change my code to use 'getName()' and prevent the odd case. Just thought I'd report, if anyone is interested in making APIs/properties consistent (and, work as implied by documentation?). Thanks,
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.