Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Writing to zip file with Eclipse EFS
Writing to zip file with Eclipse EFS [message #656156] Thu, 24 February 2011 06:21 Go to next message
Eclipse UserFriend
I have a plugin where I want to mount a zip file in the file system;
this file should be part of the project (not the project itself).
As a lot of other Eclipse related stuff, I can't find any good documentation Razz
To implement the reading I have used this tutorial: http://www.eclipsezone.com/articles/efs/.
The problem I have is to implement the write support. I have figured I have to implement openOutputStream, but I can't figure out how to do it.

Does anyone know how to do this? Is there any existing implementations?
Re: Writing to zip file with Eclipse EFS [message #657336 is a reply to message #656156] Wed, 02 March 2011 08:40 Go to previous messageGo to next message
Eclipse UserFriend
It appears my question was a bit vague, so I'll try to clarify a bit.

When implementing a writable file system, you need to override mkdir, delete and openOutputStream.
Specifically I'm having a hard time implementing openOutputStream.
As of now I'm returning a ZipOutputStream from ZipRootItem when openOuputStream is called. This doesnt make much sense though, as I need to append ZipEntry's and the actual files that should be written.

What is the best strategy to solve this?
Is it possible to to write only one file to the zip file?

I'll provide more info if needed Smile
Re: Writing to zip file with Eclipse EFS [message #657382 is a reply to message #657336] Wed, 02 March 2011 10:57 Go to previous messageGo to next message
Eclipse UserFriend
You might want to look into how EMF implements ArchiveURIHandlerImpl and
ArchiveURLConnection as an example for how to implement delete and
update only a single entry.


navlelo wrote:
> It appears my question was a bit vague, so I'll try to clarify a bit.
>
> When implementing a writable file system, you need to override mkdir,
> delete and openOutputStream. Specifically I'm having a hard time
> implementing openOutputStream. As of now I'm returning a
> ZipOutputStream from ZipRootItem when openOuputStream is called. This
> doesnt make much sense though, as I need to append ZipEntry's and the
> actual files that should be written.
> What is the best strategy to solve this?
> Is it possible to to write only one file to the zip file?
>
> I'll provide more info if needed :)
Re: Writing to zip file with Eclipse EFS [message #658008 is a reply to message #657382] Fri, 04 March 2011 18:22 Go to previous message
Eclipse UserFriend
Have you looked at an EFS implementation from org.eclipse.ui.examples.filesystem? It treats a zip file as the backing file system.
Previous Topic:standaloneUpdate -search "connection error"
Next Topic:[SOLVED] How to Use Eclipse Error Dialog with Preference Pages Extension
Goto Forum:
  


Current Time: Mon Jul 07 19:56:43 EDT 2025

Powered by FUDForum. Page generated in 0.04182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top