BufferedInputStream is;
BufferedOutputStream dest;
FileOutputStream fos;
File nameForDirCreating;
ZipFile zipfile;
ZipEntry entry;
ZipFile zipfile_test = new ZipFile(filename, consoleEnc);
Enumeration e;
InputStream entryStream;
int BUFFER = 2048;
int count;
float countFiles = 0;
float countProcessedFiles = 0;
int countProgress;
byte data[];
FileOutputStream fosForXML;
OutputFormat of;
XMLSerializer serializer;
Element XMLelement = null;
Node XMLnode = null;
// Document (Xerces implementation only).
Document xmldoc = new DocumentImpl();
// Root element.
Element mainElement = xmldoc.createElement("mainElement");
Element rootFilesForDeleting = xmldoc.createElement("filesForDeleting");
Element rootDirsForDeleting = xmldoc.createElement("foldersForDeleting");
Element mainDir = xmldoc.createElement("mainDir");
SomeFunctionsForInstaller SomeFunctionsForInstaller = new SomeFunctionsForInstaller();
Map<Integer, String> tmpfileNamesForShortcuts = new HashMap();
ArrayList<Map> fileNamesForShortcuts = new ArrayList<Map>();
SomeFunctionsForInstaller SomeFunctionsForInstallerLocal=new SomeFunctionsForInstaller();
if (zipfile_test.getEncoding() == null) {
zipfile = new ZipFile(filename, consoleEnc);
} else {
zipfile = new ZipFile(filename, zipfile_test.getEncoding());
}
zipfile_test.close();
e = zipfile.getEntries();
while (e.hasMoreElements()) {
countFiles++;
entry = (ZipEntry) e.nextElement();
localFileName = entry.getName();
if (localFileName.endsWith("/")) {
localFileName = MainFrame.destinationFolder + localFileName;
XMLelement = xmldoc.createElementNS(null, "folderForDeleting");
XMLelement.setAttributeNS(null, "pathToDir", localFileName);
XMLnode = xmldoc.createTextNode(localFileName);
XMLelement.appendChild(XMLnode);
rootDirsForDeleting.appendChild(XMLelement);
nameForDirCreating = new File(MainFrame.destinationFolder + entry.getName());
nameForDirCreating.mkdirs();
}
}
e = zipfile.getEntries();
while (e.hasMoreElements()) {
countProcessedFiles++;
countProgress = (int) (countProcessedFiles / countFiles * 100);
SwingUtilities.invokeLater(new UpdateProgressBarTask(
MainFrame.jPB1, countProgress));
MainFrame.jPB1.repaint();
count = 0;
data = new byte[BUFFER];
entry = (ZipEntry) e.nextElement();
localFileName = MainFrame.destinationFolder + entry.getName();
if (!localFileName.endsWith("/")) {
XMLelement = xmldoc.createElementNS(null, "fileForDeleting");
XMLelement.setAttributeNS(null, "pathToFile", localFileName);
XMLnode = xmldoc.createTextNode(localFileName);
XMLelement.appendChild(XMLnode);