public ZipPacker(String directory)
    {
    	Path path = Paths.get(directory);
    	String fileName=path.getFileName().toString();
    	String folder = directory.replaceAll(fileName, "");
    	fileName=fileName.replaceAll(" ","");
    	fileName=fileName.replaceAll("[^A-Za-z0-9]", "_");
    	fileName=fileName.substring(0,fileName.length()-4)+".zip";
    	directory=folder+fileName;
        file=new File(directory);
        if(file.exists())
        {
        	file.delete();
        }
        try {
            output=new ZipOutputStream(new FileOutputStream(file));
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ZipPacker.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }