Home Discussion Discuss: Zip Folder Using Java

  • To zip a folderGeo January 27, 2012 at 2:28 PM

    To zip contents of a folder and its subfolders in Windows, replace, out.putNextEntry(new ZipEntry(files[i])); with out.putNextEntry(new ZipEntry(files[i]).replace(inFolder+"\\,""));

  • ZipFolder using JavaJai June 20, 2012 at 10:38 PM

    G8! Thanks it worked! Also plz post on how to use java.util.jar.Pack200 in order to compress a jar file.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java Beginners

Java lock file or folder.
Java lock file or folder.  Is it possible to create a desktop application to lock or encrypt file or folder in windows by using java code?? if possible can provide some reference?? because i can't find it... thanks 

Java Tips and Examples

Zip Folder Using Java
; In this example we are going to create a zip folder and all files contained in this folder are zipped by using java. Here we will learn how to compress files... which have to compress and in the second object we pass the name of zip folder 

Java Beginners

Folder in Java.
Folder in Java.  I have any problem how to make Folder in java program? Can Anybody help me in this part 

Java Beginners

How to upload and save a file in a folder - Java Beginners
and save a file in a folder? for example Agreement.jsp File: So when...; Hi Friends, I need that code using servlets and jsp..... Please let me..., Thanks for your code.... Do i need any jarfiles to be placed in lib? Java 

Java Beginners

Java Util Zip. Zip files/folders inside a folder, without zipping the original source folder.
Java Util Zip. Zip files/folders inside a folder, without zipping the original... srcFile, ZipOutputStream zip) throws Exception { File folder = new File... TEMP and zip into a file named Final.jar located in the folder Final. Now 

Java Beginners

copy file from folder to folder - Java Beginners
copy file from folder to folder   my requirement is I need to copy xml files from one folder to another my source file contains the field filename.... Suppose in the source file, file name is goodfile1.xml source folder 

Java Beginners

Zipping folder - Java Beginners
to zip a user selected folder . this folder may contain any number of folder and sub folders. i saw an example in this site showing , how to zip a folder, i executed... solve this.. zipping folder and all of its files and sub folders. thanking 

JSP Servlet Questions

Delete image from folder - JSP-Servlet
when user will logout using java code. anybody having idea about then please.... that image name based on user id and that image is going to on folder in server after 

JSP Servlet Questions

Delete image from folder - JSP-Servlet
image name like : Pie(userid).png which alocated in my server folder when...).png if you have any java code for deleting this please send me. not JDBC code... the problem in details. Thanks   Using this concept you can delete 

Java Beginners

image save to folder in java
image save to folder in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open... folder and that path stored into database, for furhter retrivation. Please guide me 

Java Beginners

Zipping folder - Java Beginners
to zip a user selected folder . this folder may contain any number of folder and sub folders. i saw an example in this site showing , how to zip a folder, i executed... solve this.. zipping folder and all of its files and sub folders. thanking 

PHP Questions

Compressing a folder into GZIP format using PHP Windows
Compressing a folder into GZIP format using PHP Windows  How to gzip compress a folder/directory in PHP using windows 

Java Beginners

java program to copy the contents of one folder to another folder
java program to copy the contents of one folder to another folder  java program to copy the contents of one folder to another folder   Have a look at the following link: Java Copy one folder to another 

Java Beginners

How to access the image file from project folder itself while writing to pdf using itext?
accomplish this.I am using simple java program to write the pdf.Not a servlet.Thanks...How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image 

Swing AWT

java client server program for playing video file(stored in folder in the same workspace) using swings
java client server program for playing video file(stored in folder in the same workspace) using swings  Hello friends this is RAGHAVENDRA, I am doing a client server program to play a video file, when I run both client and server 

Swing AWT

java client server program for playing video file(stored in folder in the same workspace) using swings
java client server program for playing video file(stored in folder in the same workspace) using swings  Hello friends this is RAGHAVENDRA, I am doing a client server program to play a video file, when I run both client and server 

Swing AWT

java client server program for playing video file(stored in folder in the same workspace) using swings
java client server program for playing video file(stored in folder in the same workspace) using swings  Hello friends this is RAGHAVENDRA, I am doing a client server program to play a video file, when I run both client and server 

Swing AWT

java client server program for playing video file(stored in folder in the same workspace) using swings
java client server program for playing video file(stored in folder in the same workspace) using swings  Hello friends this is RAGHAVENDRA, I am doing a client server program to play a video file, when I run both client and server 

Java Beginners

How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  How to copy an image from one folder to another folder using jsp 

Java Beginners

how to backup files and folder with Java
how to backup files and folder with Java  Does anyone know to create a backup with java?. backup files and folders from my computer to an external...:\\Documents and Settings\\bharat\\Desktop\\bipul\\New Folder\\TableExample.java 

JSP Servlet Questions

How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  ... be in my image folder...so,How to copy an jpeg image from one folder to other folder using jsp or servlet 

Development process Questions

Java sdk/java poi hssf code to creat excel with folder structure,( i,e folders, subfolders and childrens )
. i need some help in getting folder structure using this java . Folder... on Java sdk of business objecsts . i need some help in getting folder structure using...Java sdk/java poi hssf code to creat excel with folder structure,( i,e folders 

General

Java get Folder Size
Java get Folder Size     ... of specified folder.  In the given example, we are going to show you the size of specified folder and also the number of files and folders that are presented 

JSP Servlet Questions

Image name,image path into database and image into folder using jsp
Image name,image path into database and image into folder using jsp  How to insert image path and image name into oracle database and image into folder using jsp 

Struts Questions

Java- Save Image into project folder in web application
Java- Save Image into project folder in web application  I have a requirement of saving the image into project folder .. which is a web application. I am not able to figure out how to find the absolute path of my folder which I 

JSP Servlet Questions

Full path of image to save it in a folder
in the local context of your project, then you may first create a folder under WEB... are a beginner, I would suggest that you create a servlet and call it from the page using... of either JDBC or JPA, whichever is known to you. 2. saving the file in a folder 

Ajax Questions

show folder on server by clicking a row in table using jsp and ajax
show folder on server by clicking a row in table using jsp and ajax  ... display the table. Now if i click on a row it should open a folder in server (selected dropdown value will be the folder name in server).And this folder 

Ajax Questions

show folder on server by clicking a row in table using jsp and ajax
show folder on server by clicking a row in table using jsp and ajax  ... display the table. Now if i click on a row it should open a folder in server (selected dropdown value will be the folder name in server).And this folder 

Java Interview Questions

How I Choose a folder - Java Interview Questions
do not explain clearly my question. I know how I get files from a folder. My question How I select a folder. From this selected folder i get the files. I know how I get files but the problem How I choose a folder. Thanks 

Java Server Faces Questions

create folder chooser - Java Server Faces Questions
create folder chooser  I don't know how to create a browser folder( to save file download, for instance, not file chooser), please help me,(use swing), thanks   Hi Friend, Try the following codes: 1) import 

DMCA.com