Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

reg zip file creation

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,
I am having a problem with zip file creation for creationg zip file i have return on method:
public void CreateZipFile(String zipFileName, String[] ToCompressFiles)
{
try
{
String[] fileNames = ToCompressFiles;

FileInputStream inStream;

FileOutputStream outStream = new FileOutputStream(zipFileName);
ZipOutputStream zipOStream = new ZipOutputStream(outStream);
zipOStream.setLevel ( Deflater.BEST_COMPRESSION );
for (int loop=0;loop < fileNames.length; loop++)
{
inStream = new FileInputStream(fileNames[loop]);
zipOStream.putNextEntry(new ZipEntry(fileNames[loop]));
int i=0;
while ((i=inStream.read())!=-1)
{
zipOStream.write(i);
}
zipOStream.closeEntry();
inStream.close();
}
zipOStream.flush();
zipOStream.close();
}
catch (IllegalArgumentException iae)
{
iae.printStackTrace();
}
catch(FileNotFoundException fe)
{
System.out.println("File not found===="+fe);
}
catch (IOException ioe)
{
System.out.println("IOException===="+ioe);
ioe.printStackTrace();
}
}

but with this iam getting exception message:

File not found====java.io.FileNotFoundException: R:\datacenter\UHC\hcfa-h\data\07023\13421771-hcfa-h (Access is denied)

but manually i am able to create zip file in my server.........

so please help me with this

Regards,
Vijay
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question in multiple forums. It causes duplication of effort and confusion as the community tries to help everyone.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic