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

Creating file items in SCM : IFileItem.CONTENT_TYPE_UNKNOWN vs IFileItem.CONTENT_TYPE_TEXT

Hello All,

We are using following code to create file item :

    aFile = (IFileItem) IFileItem.ITEM_TYPE.createItem();
    aFile.setParent(parentFolder);
    aFile.setName(name);
    aFile.setContentType(IFileItem.CONTENT_TYPE_UNKNOWN);

but setContentType can have the values :
CONTENT_TYPE_TEXT
CONTENT_TYPE_XML
CONTENT_TYPE_UNKNOWN,

Also, for copying the contents we have :
 IFileContentManager contentManager = FileSystemCore.getContentManager(fTeamRepository);
             IFileContent storedzipContent = contentManager.storeContent(
                 IFileContent.ENCODING_UTF_8,
                 FileLineDelimiter.LINE_DELIMITER_NONE,
                 new VersionedContentManagerByteArrayInputStreamPovider(
                         contents.toByteArray()), null, fMonitor);,
                 new VersionedContentManagerByteArrayInputStreamPovider(
                         contents.toByteArray()), null, fMonitor);

But few questions remains unanswered for us.. please help :

1. When should we use CONTENT_TYPE_UNKNOWN ? how is it different from CONTENT_TYPE_TEXT ?

2. If we use CONTENT_TYPE_TEXT, it is supporting all the formats we need, including xml, then why do we have CONTENT_TYPE_XML also ? is it something that CONTENT_TYPE_TEXT cant support XML ?

3. Is there any dependency between CONTENT_TYPE_UNKNOWN, ENCODING_UTF_8 and
LINE_DELIMITER_NONE.

Please suggest where can we get more info on this.

Thanks.

0 votes



One answer

Permanent link

I can only use common sense to answer this.

CONTENT_TYPE_TEXT is text and will be treated as such. Files with this content will likely show up as text representation in the web UI. You can likely merge them and the line delimiter and encoding actually have a purpose.

I don't know about CONTENT_TYPE_UNKNOWN and the rules that apply. I have, in the past, when I was unsure tried to look at what the tooling does. You can see all these values as properties of the elements in the Eclipse views. So you can check in content such as text files and xml files and other stuff and look at what you get. There is also a mapping defined for what is text or binary in the Eclipse client.

So, if you are unsure, play with content and have a look what the RTC client does.

0 votes

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
× 11,092
× 1,210

Question asked: Aug 08 '17, 4:41 a.m.

Question was seen: 4,111 times

Last updated: Aug 09 '17, 4:01 a.m.

Confirmation Cancel Confirm