You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Sergey Vladimirov <vl...@gmail.com> on 2011/08/11 20:38:45 UTC

Changing content of DocumentEntry or copy it

Hi all!

Is there a way to change content of DocumentEntry in POIFSFileSystem,
not using delete-and-create paradigm?

And, by the way, is there a way to copy one document/directory
completely from one POIFS to another?

-- 
Sergey Vladimirov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Changing content of DocumentEntry or copy it

Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 23 Aug 2011, Sergey Vladimirov wrote:
> I'm okay with "EntryUtils",... but what package? 
> org.apache.poi.poifs.filesystem ?

That looks the best bet, as that's the same package that all the things it 
works with live in

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Changing content of DocumentEntry or copy it

Posted by Sergey Vladimirov <vl...@gmail.com>.
Nick,

I'm okay with "EntryUtils",... but what package?
org.apache.poi.poifs.filesystem ?

Sergey

On Tue, Aug 23, 2011 at 6:32 PM, Nick Burch <ni...@alfresco.com> wrote:
> On Mon, 22 Aug 2011, Sergey Vladimirov wrote:
>>
>> I've just moved (copy-wrap-deprecate) those 3 methods from POIDocument
>> to POIUtils (let me know if someone don't like this).
>
> I think that's probably the wrong name, and possibly the wrong package.
> They're specific to working with POIFS. I think perhaps the class living in
> the poifs.filesystem package would be better, maybe with a name like
> EntryHelper or EntryUtils?
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>



-- 
Sergey Vladimirov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Changing content of DocumentEntry or copy it

Posted by Nick Burch <ni...@alfresco.com>.
On Mon, 22 Aug 2011, Sergey Vladimirov wrote:
> I've just moved (copy-wrap-deprecate) those 3 methods from POIDocument
> to POIUtils (let me know if someone don't like this).

I think that's probably the wrong name, and possibly the wrong package. 
They're specific to working with POIFS. I think perhaps the class living 
in the poifs.filesystem package would be better, maybe with a name like 
EntryHelper or EntryUtils?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Changing content of DocumentEntry or copy it

Posted by Sergey Vladimirov <vl...@gmail.com>.
Hi all,

I've just moved (copy-wrap-deprecate) those 3 methods from POIDocument
to POIUtils (let me know if someone don't like this). I need to call
those methods from some internal classes (like ObjectPoolImpl) that do
not extends POIDocument.

Nick, thanks :)

Sergey

On Fri, Aug 12, 2011 at 1:13 AM, Nick Burch <ni...@alfresco.com> wrote:
> On Thu, 11 Aug 2011, Sergey Vladimirov wrote:
>>
>> Is there a way to change content of DocumentEntry in POIFSFileSystem, not
>> using delete-and-create paradigm?
>
> Nope, the old POIFSFileSystem model is append/delete only. The new
> NPOIFSFileSystem is designed to support all of append, delete and replace.
> However, I've not quite got the write support finished - it's almost there
> but there are a few outstanding bugs. Hopefully soon enough I'll get the
> time to identify what's wrong and fix it!
>
>> And, by the way, is there a way to copy one document/directory completely
>> from one POIFS to another?
>
> Yup, there's handy methods on POIDocument to do it for you (HWPFDocument has
> that as a baseclass)
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>



-- 
Sergey Vladimirov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: Changing content of DocumentEntry or copy it

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 11 Aug 2011, Sergey Vladimirov wrote:
> Is there a way to change content of DocumentEntry in POIFSFileSystem, 
> not using delete-and-create paradigm?

Nope, the old POIFSFileSystem model is append/delete only. The new 
NPOIFSFileSystem is designed to support all of append, delete and replace. 
However, I've not quite got the write support finished - it's almost there 
but there are a few outstanding bugs. Hopefully soon enough I'll get the 
time to identify what's wrong and fix it!

> And, by the way, is there a way to copy one document/directory 
> completely from one POIFS to another?

Yup, there's handy methods on POIDocument to do it for you (HWPFDocument 
has that as a baseclass)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org