Alternative APIs for reading Zip files?
Hi all.
At the moment, our application handles zip files by copying the zip file to the temp directory and then creating a new ZipFile. However, the larger the zip file we encounter, the slower this copy becomes. We also need random access to the Zip file, so the usual workaround of using ZipInputStream is also slow, although slightly faster for random access than copying the entire file.
I raised a bug requesting a better constructor for ZipFile, but it was turned down as they seemed to think I didn't want random access.
But does anyone know of any alternative APIs which can access Zip files in a more random access fashion? I've discovered a few other alternative implementations of ZipFile, but all of them so far have had this issue of requiring a File.
intensive. I am basically searching through zip
files to find a file and then taking that inputstream
for processing. I am basically looping through the
zip file until i match the filename....pretty crazy.I think it is pretty I/O intensive...hence slower
to see what I can do to increase performance. I am
using the following parameters:
-Xms512m -Xmx1024M -Xss16M -XX:ThreadStackSize=256
-XX:MaxPermSize=256m
Parameters look ok. I am not sure what -XX:ThreadStackSize will do as -Xss also sets the stack size? you can also try to pass -server and keep both Xms and Xmx to 1024 and see if it brings any improvement.
-BJ
Similar Messages
-
Java API for reading Excel Files.
Hi,
Can you please suggest me any api for reading excel files.
Right now i am using jxl.jar for this purpose but i am searching for an open source java api better than this.
Whether POI gives better than this ?
Thanks,
Amit Shah.Can you please suggest me any api for reading excel
files.
Right now i am using jxl.jar for this purpose
but i am searching for an open source java api better
than this.
Whether POI gives better than this ?i don't know about jxl but poi has several features which an excel can contain and it has been vastly improved in the past few versions. -
Api for reading .cfg files
Hello everyone,
Once I saw an api for reading typical .cfg files, in which ## are comments, [xx] are labels... Now I need to use it but I don't remember the api any more.
Can somebody tell me which class do I have to use?
Thanks a lotNow I need
to use it but I don't remember the api any more.http://java.sun.com/docs/
There is nothing that I'm aware of in the api that has the same functionality as MFC GetPrivateProfileString(...)
You could use a properties files like most other people, otherwise you are going to have to implement it yourself. -
How to set password for a zip file and should be checked when reading that
Hi friends,
how to set password for a zip file and should be checked when reading that file???
thanks.
Praveen Reddy.JHeyy man, i think, u did not get my problem.
all i have to do is:
i have to create a zip file, and we should secure it with password when creating. and whenever the user wants to open that zip file he should provide correct passowrd otherwise he could not read that file. So, we should check for that also.
Tanks for reply. -
Customised module for reading Excel files.
Hi Gurus,
I have to develop a customsed java module for reading Excel files from PI. I downloaded NWDS 7.31 from following location NWDS Download links - Java Development - SCN Wiki. I have installed it on my local laptop. For developing the module I need following Jar files.
com.sap.aii.af.ms.svc_api
com.sap.aii.proxy.svc_api.jar
com.sap.aii.sec.svc_api.jar
com.sap.aii.utilxi.server.jar
com.sap.aii.utilxi.core.jar
com.sap.xi.mapping.tool.lib_api.jar
sap.com~tc~bl~txmanagerimpl~plb~impl.jar
sap.com~tc~je~appcontect_api~API.jar
com.sap.aii.af.cpa.svc.api
com.sap.aii.af.lib.mod
com.sap.aii.af.ms.ifc_api
com.sap.aii.af.svc_api
com.sap.xpi.ib.mapping.lib
1. Where can i get these jar files. I checked these files in my downloaded NWDS 7.31 package, but cold not find them.
Thanks in advanceHi.
Check this thread.
Where to get the libraries for XI development - Process Integration - SCN Wiki
Regards
Lucho -
File Adapter to read Zip file and send it as input to another webservice
Hi,
I have the below requirement:
1. A service will generate 3 attachments and place it in a particular directory.
2. SOA service has to pick those 3 files and send those files as input to another custom application which will email.
Design :
1. First SOA will create an archive file of those 3 attachements and then file adapter will poll for that zip file in that location and send that file as a whole to the custom application.
Query:
Now my question, is the above design feasible? If so, how to configure the file adapter to pass the file as input to that custom application?
Kindly do the needful
Thanks,
PriyaYou can accomplish this via java embedding activity...Create a java embedding, which will create a zip file.. this java code is easy to implement..
You can also do away with un-necessary polling file adapter.. and you can use "Synchronous File Read" operation of File Adapter.. For Sync Read, you'll have to pass the zip file name, which you can easily fetch from java embedding activity..
Let me know, if this doesn't work. -
Does Adobe provide a free API for creating PDF files
Does Adobe provide a free API (for Windows) for creating PDF files? We are currently using
a basic, internally developed API for creating PDF files, but would like some additional
capabilities ... in particular the ability to add a watermark that appears when printing
but not when viewing PDF files on-line.
If this is not the right forum for this question, please let me know what forum would be
appropriate.
Thanks,
MarkOK, with a little bit of searching on Adobe's web site, I found the answer to my question. Yes, Adobe does offer
an API for creating/manipulating/reading PDF files: it's called the Adobe PDF Library SDK and it has to be
licensed. Version 9 is the latest. The cost is decided on a case-by-case basis. Here is the link:
http://www.adobe.com/devnet/pdf/library/
Mark -
Read zip files created by ZipOutputStream
Hello :)
I am wondering if it is possible to create a zipfile using ZipOutputStream, which can be read using ZipInputStream with out using the ZipFile work-around discussed in http://forum.java.sun.com/thread.jspa?forumID=256&threadID=492219. This is no option for me, because we have a lot of client applications deployed, which cannot easily be altered.
Are there any (third-party) libraries which I can use?
-M1chaeltry it
// These are the files to include in the ZIP file
String[] source = new String[]{"source1", "source2"};
// Create a buffer for reading the files
byte[] buf = new byte[1024];
try {
// Create the ZIP file
String target = "target.zip";
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(target));
// Compress the files
for (int i=0; i<source.length; i++) {
FileInputStream in = new FileInputStream(source);
// Add ZIP entry to output stream.
out.putNextEntry(new ZipEntry(source[i]));
// Transfer bytes from the file to the ZIP file
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
// Complete the entry
out.closeEntry();
in.close();
// Complete the ZIP file
out.close();
} catch (IOException e) { -
Program to read zip files???
im looking for a program to read zip files?Is this even possible on a mac? Im running 10.4.11 on my ibook g4
Hello,
What you need is a program that can OPEN .zip files. Go here: http://my.smithmicro.com/mac/stuffitexpander/index.html
Download the free installation and just follow the instructions to open .zip files.
Carolyn -
Error reading zip file in Java 6
We have a bespoke installer program that fails, intermittently, in Java 6 on Windows. After installing some files, it then fails with a stack trace like this:
java.util.zip.ZipException: error reading zip file
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1200(ZipFile.java:29)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447)
at java.util.zip.ZipFile$1.fill(ZipFile.java:230)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at com.XXXX.trent.installer.Installer.writeStreamToFile(Unknown Source)
at com.XXXX.trent.installer.Installer.installFile(Unknown Source)
at com.XXXX.trent.installer.PatchFileInstaller.installFile(Unknown Source)
at com.XXXX.trent.installer.PatchFileInstaller.installFiles(Unknown Source)
at com.XXXX.trent.installer.UpgradeInstaller$TpfAction.run(Unknown Source)
at com.XXXX.trent.installer.UpgradeInstaller.runActions(Unknown Source)
at com.XXXX.trent.installer.UpgradeInstaller.install(Unknown Source)
at com.XXXX.trent.installer.TrentInstall$SoftwareInstallStage.install(Unknown Source)
at com.XXXX.trent.installer.TrentInstall$UpgradeInstallWorker.install(Unknown Source)
at com.XXXX.trent.installer.PatchInstall$InstallWorker.construct(Unknown Source)
at com.XXXX.trent.utils.SwingWorker$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)The same code works in Java 5 on the same environments that it now fails in Java 6 (1.6.0_16).
Any ideas?
Thanks.gimbal2 wrote:
it is not weird, it is a bug in the application. Don't let the upgrade from Java 5 to Java 6 make you believe otherwise.It's a singularly bad exception message though. I would have thought that something from java.util might be a bit more explicit about what the problem is.
Winston -
Open data set for reading excel file on application server in back ground
open data set for reading excel file on application server in back ground
hi Vijay,
I am afraid you won't be able to read from Excel file on Appl. Server.
ec -
Creation of Password for the Zip file which are sent thru email
Dear Experts,
how to create a password for the zip file which is sent via email through a abap program.
OR
how to create a password in abap for a zip file.
Thanks...
Vishal
Edited by: vishal_reddy786 on Jun 22, 2010 7:31 AMUNSOLVED
-
How to create a method for reading a file
i tried to make it as static method for reading a file and
then to return string
is this code correct?
public static String fileMaterial(String fileName)
fileReader = new BufferedReader(new FileReader(fileName));
info = fileReader.readLine();
while(school != null) {
return info;
info = fileReader.readLine();I created a class you might want to look at. I come from a world of C and love fgets() and other FILE stream functions. I created a class that uses the Java I/O buts to the calling application behaves like fgets and such. The block of code where I do the calling in the calling program even looks like C. In my class I capture almost all errors and set error buffers to the errors. The calling program looks at the return to see if it succedded or errored.
BuffIO new = BuffIO.fopen("fiilename", "r");
String s;
if((s = new.fgets()) == null)
System.err.println("error reading file: " + new.ferror());
That would be waht the calling program does -
How do I make Adobe Reader NOT my default program for reading pdf files?
I installed Adobe Reader and made it my default program for reading pdf files. I'd like to undo that and go back to "preview" as my default.
Sure you are following instructions:
-
How to read ZIP files(having PDFs,Image) using MQ Series link for R/3
Hi,
1)Is it possible to transfer a zip file (having an image or pdf) using IDocs in SAP 4.6C using MQ Series link for R/?
Scenario: "MQ Series link for R/3" converts Business-Reports from a third-party software,into SAP IDocs.Each Business-Report contains one XML file and one ZIP file.
2)Being on ABAP side,do I have to worry about how the zip file would be converted into IDocs?
Detailed descrption:
This scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I want someone who has worked in a similar scenario to confirm this.Hi,
I have a feeling I have posted this question in the wrong forum or maybe I will let you decide this.Any help would be appreciated (even the right forum name).
My scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I wanted someone who has worked in a similar scenario to confirm this.
Maybe you are looking for
-
I just updated to 10.9.2 and now my monitor cannot rotate
I just updated to 10.9.2 and now my palette monitor has: 1) Lost the ability to rotate 2) Forgotten my background image 3) Changed resolution It is a LG Flatron E2351. I have found others having similar problems and one person has solved it using 'su
-
I wanted to buy an album and it changed my store to the UK, how do I change it back to the usa
I recently watched the movie Monster in Paris, I wanted to purchase the soundtrack, and went to iTunes on my IPad, it told me the soundtrack wasn't available in the us, that I would need to go to the UK store to do so, and it changed it automatically
-
How to disable 'Remove Hidden Information' popup when closing PDF in Acrobat X on Mac?
How do I disable the function that causes the 'Remove Hidden Information' popup when closing PDFs in Acrobat X? I'm using OS X 10.9.4 on a Mac? I've searched online and was directed to Preferences>>Security (enhanced) to uncheck 'Unable Enhanced Secu
-
Bonjour Print Services Install: DLL could not be run
Hi guys, When trying to install Bonjour Print Services on a newly installed copy of Win7, I am getting the following error There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact y
-
my kids reset my ipod touch i have a Toshiba laptop i tried downloading i tunes but an error comes up Apple application support Error 2 what do i do