private boolean zipAllFiles() {

    File zipFile = new File(zipFileName);
    int index = 0;
    while (zipFile.exists()) {
      if (!zipFile.delete()) {
        ++index;
        zipFileName = "LogFiles_" + index + ".zip";
        zipFile = new File(zipFileName);
      }
    }

    try {

      FileOutputStream fos = new FileOutputStream(zipFileName);

      ZipOutputStream zos = new ZipOutputStream(fos);

      File[] files = dir.listFiles();

      for (int i = 0; i < files.length; i++) {

        FileInputStream fis = new FileInputStream(files[i]);

        // begin writing a new ZIP entry, positions the stream to the start of
        // the entry data
        zos.putNextEntry(new ZipEntry(files[i].getName()));

        int length;

        while ((length = fis.read(fileBuffer)) > 0) {
          zos.write(fileBuffer, 0, length);
        }

        zos.closeEntry();

        // close the InputStream
        fis.close();
      }

      // close the ZipOutputStream
      zos.close();

    } catch (IOException ioe) {
      return false;
    }

    return true;

  }