It's all about the answers!

Ask a question

Using plain Java API to upload files to a existing RTC component


Joao Bordignon (383) | asked Apr 11 '18, 9:19 a.m.
Hi, we have a process that creates a bunch of text files every week and save then in a directory.

I was tasked to find a way of uploading theses files automatically to a RTC repository component, so we can keep the change history of these files.

From what I gathered, the plain java api may work in this case, but I'm lost on how to use it.

Can someone point me in the right direction?

Thanks!

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Apr 11 '18, 10:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The source control command line would be an easier approach: https://jazz.net/help-dev/clm/index.jsp?topic=%2Fcom.ibm.team.scm.doc%2Ftopics%2Fc_scm_cli.html

Plain Java: here is an example: https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/ the blog post also hints how to set up your environment and what you want to do in addition.
This might be interesting as well: https://rsjazz.wordpress.com/2014/09/02/reading-and-writing-files-directly-from-and-to-an-rtc-scm-stream/




Joao Bordignon selected this answer as the correct answer

Comments
Joao Bordignon commented Apr 11 '18, 11:16 a.m.
Hi Ralph!

I had already read the last 2 links (are you the author?)

The command line appears tempting, but unfortunately I have no permission to install any software in the server where my application will run.

In the third link, the one writhen by Kevin, from what I understood, one can not create a new file directly, just change the contents of existing ones. Is this correct?

Thank you!

Ralph Schoon commented Apr 11 '18, 11:25 a.m. | edited Apr 11 '18, 11:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you can not install the SCM command line and the scripts to use it, how are you able to install the plain java client libraries (JAR files) and the application you developed?

Yes, I am author of that blog. The first link is based on my work, the second is based on a colleagues work. I try to make clear who contributed if I refer to others work in my blog.

You can check in and deliver new files (which creates the first version) and you can also check in and deliver a new version with changes. This is the same for the SCM commandline, and the plain java API.

The Plain Java API does
- Not necessarily have to load the repository workspace to share/check in
- Not necessarily need a representation as a local file. E.g. in the example with the zip file, the data is directly read from the zip file. If you calculate a file somehow, the data could be shared directly out of memory

The last items I don't know if this could be done with the SCm command line.


Ralph Schoon commented Apr 11 '18, 11:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Last but not least, the API always has the caveat that there is no person to approach that will be able to tell you how that works. I only know what I have done and explained in my blog. That can be only a very small area of the available APIs. I am not really good with the SCM API. If you get into trouble, you might be the only person that can save you by looking into the SDK.


Joao Bordignon commented Apr 11 '18, 11:52 a.m.
Ralph, thank you again!

I was just curious if you are the same Ralph who wrote the blog posts I had read, so I can thank you, they are really helpful.

I will do some experiments, since it appears that there are no easy way out for me.

About this:
If you can not install the SCM command line and the scripts to use it, how are you able to install the plain java client libraries (JAR files) and the application you developed?
Do not underestimate how stupid a big corporation bureaucracy can be. Apparently arbitrary code and random libraries are fine, but mention the words "install, "tool" or "script" and all hell comes loose.

Have a nice day!

Geoffrey Clemm commented Apr 11 '18, 5:14 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Yes, the Ralph answering this question is the Ralph who wrote the blog posts. 


Ralph Schoon commented Apr 12 '18, 2:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Joao,

you can basically unzip the SCM Command Line. It is no "Install" 8).

The SCM Command Line is the easiest way, I think. Java Is more effort.

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.