chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Danninger <sebastian.dannin...@googlemail.com>
Subject Re: Deleting content of a file
Date Mon, 28 Jan 2013 13:31:13 GMT
Okay, I was just wondering, so for Alfresco I came up with this solution
(in case someone else might need it)

        String str ="";
        InputStream bais = new ByteArrayInputStream(str.getBytes());
        ContentStream cs = new ContentStreamImpl(filename,
BigInteger.valueOf(Long.parseLong("0")), "UTF-8", bais);
        doc.deleteContentStream(true);
        doc.setContentStream(cs, true);


2013/1/28 Florian Müller <fmui@apache.org>

> Hi Sebastian,
>
> From a CMIS point of view deleteContentStream() is what you are looking
> for.
> Not all repositories support it, though. Some repositories need a content
> stream with 0 bytes. You should ask the repository vendor.
>
>
> Florian
>
>
>
>  Dear all,
>>
>> is there an easy way of deleting the content of a file, without removing
>> the file itself (clearing it)?
>>
>> I saw that i can call setContentStream with a new contentstream and that
>> there is a deleteContentStream but then the file is "broken"
>>
>> The node's content is missing:
>>    node: workspace://SpacesStore/**28c5a8f1-9589-455c-9afe-**262438c61c61
>>    reader: null
>>
>> any suggestions?
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message