Skip to Content
author's profile photo Former Member
Former Member

Writing information from a StringBuffer into a text file in KM

Hello All,

Is there a way to write content such as a text file into the KM.

The only way I can see at this point is:

1. create a resource

2. transfer stringBuffer into an inputStream

3. Update the resource with the inputStream

This feels awkward and I have not tried it yet. Basically I want to write reports into a KM directory.

Points awarded to helpful answers. Thanks!

Cory

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 01, 2005 at 07:18 AM

    createResource always takes InputStreams. Why is that a problem? Just use string.toBytes(encoding) and ByteArrayInputStream to obtain a stream for that.

    Just be sure that you're consistent in the character encodings you use when obtaining the byte array from the string (UTF-8 recommended) and when creating the Content object.

    Best regards, Julian

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.