public void zipStorageData(LocalStorageData localStorageData,String zipFileName) throws BusinessException, IOException {
  if (!localStorageData.isFullyDownloaded()) {
    throw new BusinessException("Zip data for the storage " + localStorageData + ".",StorageErrorCodeEnum.STORAGE_IS_NOT_DOWNLOADED);
  }
 else {
    Path zipPath=Paths.get(zipFileName);
    if (Files.exists(zipPath)) {
      Files.delete(zipPath);
    }
    try {
      super.zipStorageData(localStorageData,zipPath);
    }
 catch (    IOException e) {
      Files.deleteIfExists(zipPath);
      throw e;
    }
  }
}

public void zipStorageData ( LocalStorageData localStorageData , String zipFileName ) throws BusinessException , IOException { if ( ! localStorageData . isFullyDownloaded ( ) ) { throw new BusinessException ( "Zip data for the storage " + localStorageData + "." , StorageErrorCodeEnum . STORAGE_IS_NOT_DOWNLOADED ) ; } else { Path zipPath = Paths . get ( zipFileName ) ; if ( Files . exists ( zipPath ) ) { Files . delete ( zipPath ) ; } try { super . zipStorageData ( localStorageData , zipPath ) ; } catch ( IOException e ) { Files . deleteIfExists ( zipPath ) ; throw e ; } } }
compresses the content of the local storage data folder to the file . file name is provided via given path . if the file already exists , it will be deleted first .
