[Yanel-commits] rev 25962 - public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils

simon at wyona.com simon at wyona.com
Fri Jul 13 11:37:18 CEST 2007


Author: simon
Date: 2007-07-13 11:37:17 +0200 (Fri, 13 Jul 2007)
New Revision: 25962

Removed:
   public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateJar.java
   public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateZip.java
Log:
removed obsolete classes

Deleted: public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateJar.java
===================================================================
--- public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateJar.java	2007-07-13 09:23:04 UTC (rev 25961)
+++ public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateJar.java	2007-07-13 09:37:17 UTC (rev 25962)
@@ -1,92 +0,0 @@
-/*
- * Copyright 2006 Wyona
- */
-
-package org.wyona.yanel.impl.resources.updatefinder.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-
-public class CreateJar {
-
-    File file;
-    JarOutputStream jarOutput;
-    String source;
-    Manifest manifest = null;
-
-    public CreateJar(String destPath, String source) {
-        this.source = source;
-        try {
-            manifest = new Manifest();
-            jarOutput = new JarOutputStream(new FileOutputStream(destPath),
-                    manifest);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * This method is used to obtain the list of files present in a directory
-     * @param path of type String specifying the path of directory containing the files
-     * @return the list of files from a particular directory
-     */
-    public File[] getFiles(String path) {// This method is used to obtain the list of files in a
-                                            // directory
-        try {
-            file = new File(path);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return file.listFiles();
-    }
-
-    /**
-     * This method is used to create a jar file from a directory
-     * @param path of type String specifying the directory to make jar
-     */
-    public void createJar(String path) {// This method is used to create a jar file from
-    // a directory. If the directory contains several nested directory
-    // it will work.
-        try {
-            byte[] buff = new byte[2048];
-            File[] fileList = getFiles(path);
-
-            for (int i = 0; i < fileList.length; i++) {
-                if (fileList[i].isDirectory()) {
-                    createJar(fileList[i].getAbsolutePath());// Recusive method to get the files
-                } else {
-                    FileInputStream fin = new FileInputStream(fileList[i]);
-                    String temp = fileList[i].getAbsolutePath();
-                    String subTemp = temp.substring(temp.indexOf("bin") + 4, temp.length());
-                    // System.out.println( subTemp+":"+fin.getChannel().size());
-                    jarOutput.putNextEntry(new JarEntry(subTemp));
-                    int len;
-                    while ((len = fin.read(buff)) > 0) {
-                        jarOutput.write(buff, 0, len);
-                    }
-                    fin.close();
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Method used to close the object for JarOutputStream
-     */
-    public void close() {// This method is used to close the
-    // JarOutputStream
-        try {
-            jarOutput.flush();
-            jarOutput.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-}
\ No newline at end of file

Deleted: public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateZip.java
===================================================================
--- public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateZip.java	2007-07-13 09:23:04 UTC (rev 25961)
+++ public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/CreateZip.java	2007-07-13 09:37:17 UTC (rev 25962)
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006 Wyona
- */
-
-package org.wyona.yanel.impl.resources.updatefinder.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-public class CreateZip {
-
-    File files[];
-    ZipOutputStream zipOutput;
-
-    public void create(String destFile, File[] files, ArrayList originalPath) {
-        this.files = files;
-        try {
-            zipOutput = new ZipOutputStream(new FileOutputStream(destFile));
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        createZip(originalPath);
-        close();
-    }
-    
-    public void createZip(ArrayList originalPath) {
-        try {
-            byte[] buff = new byte[10240];
-            File[] fileList = files;
-
-            for (int i = 0; i < fileList.length; i++) {
-                    FileInputStream fin = new FileInputStream(fileList[i]);
-                    zipOutput.putNextEntry(new ZipEntry(((String) originalPath.get(i))));
-                    int len;
-                    while ((len = fin.read(buff)) > 0) {
-                        zipOutput.write(buff, 0, len);
-                    }
-                    fin.close();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Method used to close the object for ZipOutputStream
-     */
-    public void close() {
-        try {
-            zipOutput.flush();
-            zipOutput.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
\ No newline at end of file




More information about the Yanel-commits mailing list