Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Can we deliver .zip file as a changeset in RTC SCM instead of unzipping the contents

Hello All,

We have a usecase wherein, we need to deliver a given .zip file as a changeset, instead of unzipping and delivering the files.

Is it possible to deliver .zip file as it is ?
Request you to assist on this.

Thanks

0 votes

Comments

That's interesting. It works as is for me.

I'm curious how the .zip files get unzipped automatically in your environment?

Thanks for the reply Donald.
I have taken the sample example from  : https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/

However am getting the following exception when I have .zip as a child folder in my parent .zip folder.
Parent.zip
     sample.txt
     child.zip

Here it is working fine for sample.txt. but exception for child.zip

Why is this issue happening ? Please suggest on this :( Thanks

Exception :

com.ibm.team.repository.common.TeamRepositoryException: Input length = 1
    at com.ibm.team.scm.client.content.BasicVersionedContentManager$StreamLengthUtility.run(BasicVersionedContentManager.java:239)
    at com.ibm.team.scm.client.content.BasicVersionedContentManager.storeContent(BasicVersionedContentManager.java:313)
    at com.ibm.team.filesystem.client.internal.content.FileContentManager.storeContent(FileContentManager.java:306)
    at com.bosch.rtc.scm.mkstortcmigrator.ArchiveToSCMExtractor.extractFile(ArchiveToSCMExtractor.java:202)
    at com.bosch.rtc.scm.mkstortcmigrator.ArchiveToSCMExtractor.extract(ArchiveToSCMExtractor.java:157)
    at com.bosch.rtc.scm.mkstortcmigrator.ArchiveToSCMExtractor.extractFileToComponent(ArchiveToSCMExtractor.java:114)
    at com.bosch.rtc.scm.mkstortcmigrator.MksToRtcMigrator.main(MksToRtcMigrator.java:58)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
    at java.nio.charset.CoderResult.throwException(CoderResult.java:281)

Sorry, I'm not familiar with these codes. As you're following Ralph's sample, you should really seek help from @rschoon.

1 vote

@Donald Nong,
request you to assist on how you are able to checkin the .zip file in your case.
Thanks

I was not aware that you're using API when I replied. Basically I was testing a completely different use case. You can ignore all I said in this post.

1 vote

thanks for the reply Donald.

showing 5 of 7 show 2 more comments

Accepted answer

Permanent link

Yes, you can check in and deliver a zip file like any other type of file using the Java API.

Jazzuser user selected this answer as the correct answer

1 vote

Comments

but am getting the above mentioned exception when executing this below code from the sample link
             IFileContentManager contentManager = FileSystemCore
                     .getContentManager(fTeamRepository);
             IFileContent storedzipContent = contentManager.storeContent(
                     IFileContent.ENCODING_UTF_8,
                     FileLineDelimiter.LINE_DELIMITER_PLATFORM,
                     new VersionedContentManagerByteArrayInputStreamPovider(
                             contents.toByteArray()), null, fMonitor);

What could have gone wrong ?

I have a  child zipped folder  within the main zip folder(input to the RTC). 
This exception is thrown for  child zipped folder.


IFileContent.ENCODING_UTF_8: The zip file is not a text file but rather a binary, so this encoding stuff does not seem to make sense. Maybe there is something with binary?
FileLineDelimiter.LINE_DELIMITER_PLATFORM: The zip file is not a text file but rather a binary, so this line delimiter stuff does not seem to make sense. Maybe there is something with binary?

Looking at the declaration of com.ibm.team.filesystem.client.IFileContentManager.storeContent(String, FileLineDelimiter, AbstractVersionedContentManagerInputStreamProvider, ContentHash, IProgressMonitor) in the SDK shows:

@param characterEncoding
                 the character encoding of the bytes being sent, the format is
    
            specified in {@link IFileContent#getCharacterEncoding()} This value
                 is used by the HTTP server; it is <em>not</em> verified, and
    
            providing an incorrect value for this <em>may</em> result in
                 uncaught incorrect behavior.  The character encoding is used
    
            when performing validation/translation of line endings, so it
                 should be an encoding available on the server.  It
    
            does not need to be supplied when storing binary data (i.e.
     *            {@link FileLineDelimiter#LINE_DELIMITER_NONE}).

Searching in the SDK for how storeContent is used shows this example:

storeContent(null, FileLineDelimiter.LINE_DELIMITER_NONE, .............

Thanks Ralph :) this worked for me :)

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 1,202

Question asked: Jul 19 '17, 12:56 a.m.

Question was seen: 2,211 times

Last updated: Jul 24 '17, 8:30 a.m.

Confirmation Cancel Confirm