Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / May 2004

Tip: Looking for answers? Try searching our database.

read zipped files without unpacking?

Thread view: 
wEEdpEckEr - 04 May 2004 21:27 GMT
Hi,

I want to get the source code from openOffice files, in plain xml. Now,
I've installed the whole openOffice API, but this is to actually work with
the file itself. What I want, is to get the plain xml code. When opening an
openOffice document with winrar, I see that there are a few .xml files that
can be used. Now is the question: how can I open such a zipped openOffice
file in java and read the source xml code? This should be done, without
unpacking the files to the users hard disk...

thanx,
Tim
Roedy Green - 04 May 2004 23:30 GMT
> how can I open such a zipped openOffice
>file in java and read the source xml code? This should be done, without
>unpacking the files to the users hard disk...

use Zip or exec Winzip or PkZip if the compression algorithms used are
unsupported.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Michael Amling - 05 May 2004 03:35 GMT
> I want to get the source code from openOffice files, in plain xml. Now,
> I've installed the whole openOffice API, but this is to actually work with
[quoted text clipped - 3 lines]
> file in java and read the source xml code? This should be done, without
> unpacking the files to the users hard disk...

  java.util.zip.ZipInputStream should work.

--Mike Amling
Roedy Green - 05 May 2004 04:34 GMT
>   java.util.zip.ZipInputStream should work.

that unpacks each one in sequence. You want Zip to pick and choose
what you want.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
wEEdpEckEr - 05 May 2004 07:46 GMT
Roedy Green <roedy-look-on-the-website@mindprod.com.invalid> schreef op wo,
05 mei 2004 03:34:24 GMT in news:d5og90l3bu4td5hg9fsc34inggtu4k2m7c@
4ax.com:

>>   java.util.zip.ZipInputStream should work.
>
>  that unpacks each one in sequence. You want Zip to pick and choose
> what you want.

And how do I do it your way? Is this a class I can use or something? Do you
have a URL where there's something explained? Try entering "java zip" in
google, and you're flooded by unusefull information. :-s

thanx in advance
Tim
Michael Amling - 05 May 2004 12:49 GMT
> Roedy Green <roedy-look-on-the-website@mindprod.com.invalid> schreef op wo,
> 05 mei 2004 03:34:24 GMT in news:d5og90l3bu4td5hg9fsc34inggtu4k2m7c@
[quoted text clipped - 8 lines]
> have a URL where there's something explained? Try entering "java zip" in
> google, and you're flooded by unusefull information. :-s

  See
http://java.sun.com/j2se/1.3/docs/api/java/util/zip/ZipInputStream.html
for the API.

--Mike Amling
Roedy Green - 05 May 2004 22:45 GMT
>>  that unpacks each one in sequence. You want Zip to pick and choose
>> what you want.
>
>And how do I do it your way? Is this a class I can use or something? Do you
>have a URL where there's something explained? Try entering "java zip" in
>google, and you're flooded by unusefull information. :-s

You did not say if your files were local or remote, or if they are the
in the resource jar.

See http://mindprod.com/jgloss/jar.html
see http://mindprod.com/jgloss/zip.html

the java.util.ZipFile class is what you want if they are local. See
the Javadocs for it.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Michael Amling - 06 May 2004 02:16 GMT
>>> that unpacks each one in sequence. You want Zip to pick and choose
>>>what you want.
[quoted text clipped - 11 lines]
> the java.util.ZipFile class is what you want if they are local. See
> the Javadocs for it.

  I agree the OP may find that class more useful. OP, see
http://java.sun.com/j2se/1.3/docs/api/java/util/zip/ZipFile.html for the
API.
  BTW, I checked that jar -t and jar -x, which probably use the same
underlying Zip file processing routines as these Zip I/O classes, work
on a sample .sxw file.

--Mike Amling


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.