convertion

Ads
 

convertion

how to convert java class to executable file

View Answers

April 25, 2012 at 3:42 PM

import java.io.*;
import java.util.zip.*;

public class CreateZip {
public static int buffer = 10240;
protected void createZipArchive(File zipFile, File[] listFiles) {
try {
byte b[] = new byte[buffer];
FileOutputStream fout = new FileOutputStream(zipFile);
ZipOutputStream out = new ZipOutputStream(fout, new Manifest());
for (int i = 0; i < listFiles.length; i++) {
if (listFiles[i] == null || !listFiles[i].exists()|| listFiles[i].isDirectory())
System.out.println("-----------------------------------");
System.out.println("Adding " + listFiles[i].getName());
ZipEntry addFiles = new ZipEntry(listFiles[i].getName());
addFiles.setTime(listFiles[i].lastModified());
out.putNextEntry(addFiles);

FileInputStream fin = new FileInputStream(listFiles[i]);
while (true) {
int len = fin.read(b, 0, b.length);
if (len <= 0)
break;
out.write(b, 0, len);
}
fin.close();
}
out.close();
fout.close();
System.out.println("Exe File is created successfully.");
} catch (Exception ex) {}
}
public static void main(String[]args){
CreateZip jar=new CreateZip();
File folder = new File("c://Examples");
File[] files = folder.listFiles();
File file=new File("C://Examples//Application.exe");
jar.createZipArchive(file, files);
}

}

Ads









Related Tutorials/Questions & Answers:
convertion
convertion
Advertisements
convertion before downloading
convertion before downloading  convert zip file which is in server to doc while before downloading
ModuleNotFoundError: No module named 'Temu-Convertion'
ModuleNotFoundError: No module named 'Temu-Convertion'  Hi, My... named 'Temu-Convertion' How to remove the ModuleNotFoundError: No module named 'Temu-Convertion' error? Thanks   Hi, In your python
convertion of string entered in the web interface
convertion of string entered in the web interface  hi i am entering some values in the textbox of web interface.how i can access that values and convert to particular type.in short how to link web interface values with my java
date convertion
Datatype convertion
infix to post fix convertion
sahabaj
sahabaj  sir i have send u a question relating to convertion of number to words.i want to know the algorithm and variable description of the program
servlet filters
convertion , data compression etc. The filters contain the url like /*. ex

Ads