Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:21 Go to next message
Anders S is currently offline Anders SFriend
Messages: 29
Registered: February 2011
Junior Member
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 13:40 Go to previous messageGo to next message
Anders S is currently offline Anders SFriend
Messages: 29
Registered: February 2011
Junior Member
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 15:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31702
Registered: July 2009
Senior Member
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 :)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Writing to zip file with Eclipse EFS [message #658008 is a reply to message #657382] Fri, 04 March 2011 23:22 Go to previous message
Tomasz Zarna is currently offline Tomasz ZarnaFriend
Messages: 172
Registered: July 2009
Senior Member
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 Jan 18 02:31:11 GMT 2021

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

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

Back to the top