def unpack path
      raise "File #{@zipfile} not exists." unless File.exists? @zipfile
      raise "unpack path: #{path} not found." unless Dir.exists? path
      raise "unpack path: #{path} is not writable." unless File.writable? path

      files = []
      Zip::ZipFile.foreach(@zipfile) do |entry|
        next if entry.to_s == MANIFEST_FILE
        entry_name = File.basename entry.to_s
        dst_path = File.join(path, entry_name)
        dirname = File.dirname(dst_path)
        FileUtils.mkdir_p(dirname) unless File.exists? dirname
        files << dst_path
        entry.extract(dst_path)
      end
      files.freeze
      yield files if block_given?
      files
    rescue => e
      # auto cleanup if error raised.
      files.each{|f| File.delete f if File.exists? f} if files
      raise ServiceError.new(ServiceError::FILE_CORRUPTED) if e.is_a? Zlib::DataError
      raise e
    end
def unpack path
      raise "File #{@zipfile} not exists." unless File.exists? @zipfile
      raise "unpack path: #{path} not found." unless Dir.exists? path
      raise "unpack path: #{path} is not writable." unless File.writable? path

      files = []
      Zip::ZipFile.foreach(@zipfile) do |entry|
        next if entry.to_s == MANIFEST_FILE
        entry_name = File.basename entry.to_s
        dst_path = File.join(path, entry_name)
        dirname = File.dirname(dst_path)
        FileUtils.mkdir_p(dirname) unless File.exists? dirname
        files << dst_path
        entry.extract(dst_path)
      end
      files.freeze
      yield files if block_given?
      files
    rescue => e
      # auto cleanup if error raised.
      files.each{|f| File.delete f if File.exists? f} if files
      raise ServiceError.new(ServiceError::FILE_CORRUPTED) if e.is_a? Zlib::DataError
      raise e
    end
unpack the content to +path+ and return extraced file list.