RTC API - Parent folder as a Versionable
I'm currently doing:
IVersionable newparent = scmService.fetchState(versionableAfter.getParent(), new String[]{IVersionable.NAME_PROPERTY}, null);
but that's clearly wrong because I'm not specifying the state as a handle
One answer
In https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/ the method findOrCreateFolderWithParents() does this task.
The only way I found was to start with the root and look the children up until I had the one I wanted.
Comments
Hi Ralph,
I've gone through both the links and I guess in summary, if I understood things right:
1) In order to be able to do something like this we have to use classes which are not meant to be a part of the API which means that the classes' interfaces can change with newer releases and support by the extension's author would have to be provided accordingly - this is from the first Link under 'Walking the file tree to fetch content'
2)The code in both links seems to be for client-side programming. But there probably are Server-Side equivalents to the APIs used in the code.
Now here's the question: why would the class IVersionable implement the getParent() method if it isn't meant to be used by extensions?
There are areas, where internal API can't be avoided. I would like to see users requesting this API to be officially supported. Although the API in some places is internal and could change at any time, I have not seen many changes in these areas since I do this API work. I think it is safe to use these methods, but to be fair to users I have to point it out.
The server side API is usually very similar to the client side API. The services on the server are usually named com.ibm...Service as opposed to the client where they are named com.ibm...Client. Some capabilities are only available on the client.
I did not say you can't use getParent() in my case I ended up doing something different to get my code to work, because I had to check in files and I had to find and set the parent.