def upload_master_file(local_file_path, rw_pw, unmount = true, chksum: DEFAULT_CHECKSUM_HASH_TYPE )
      raise JSS::NoSuchItemError, 'Please create this package in the JSS before uploading it.' unless @in_jss

      mdp = JSS::DistributionPoint.master_distribution_point api: @api
      destination = mdp.mount(rw_pw, :rw) + "#{DIST_POINT_PKGS_FOLDER}/#{@filename}"

      local_path = Pathname.new local_file_path
      raise JSS::NoSuchItemError, "Local file '#{@local_file}' doesn't exist" unless local_path.exist?

      # should we zip it?
      if local_path.directory?
        begin
          # go to the same dir as the local file
          wd = Dir.pwd
          Dir.chdir local_path.parent

          # the contents of the zip file have to have the same name as the zip file itself (minus the .zip)
          # so temporarily rename the source
          local_path_to_upload = local_path.parent + @filename
          local_path.rename local_path_to_upload unless local_path_to_upload == local_path

          zipdir = Pathname.new "/tmp/rubyjsstmp-#{Time.new.strftime '%Y%m%d%H%M%S'}-#{$PROCESS_ID}"
          zipdir.mkpath
          zipdir.chmod 0o700
          zipfile = zipdir + (local_path_to_upload.basename.to_s + '.zip')

          raise 'There was a problem zipping the pkg bundle' unless system "/usr/bin/zip -qr '#{zipfile}' '#{local_path_to_upload}'"
        ensure
          # rename the source to the original name
          local_path_to_upload.rename local_path if local_path_to_upload.exist? && local_path_to_upload != local_path
          # go back where we started
          Dir.chdir wd
        end # begin

        # update our info
        local_path = zipfile
        destination = destination.to_s + '.zip'
        @filename = zipfile.basename.to_s
        @need_to_update = true
      end # if directory

      FileUtils.copy_entry local_path, destination

      if CHECKSUM_HASH_TYPES.keys.include? chksum
        @checksum_type = chksum
        @checksum = calculate_checksum local_file: local_path, type: chksum, unmount: false
        @need_to_update = true
      end
      update if @need_to_update
      mdp.unmount if unmount
    end
def upload_master_file(local_file_path, rw_pw, unmount = true, chksum: DEFAULT_CHECKSUM_HASH_TYPE )
      raise JSS::NoSuchItemError, 'Please create this package in the JSS before uploading it.' unless @in_jss

      mdp = JSS::DistributionPoint.master_distribution_point api: @api
      destination = mdp.mount(rw_pw, :rw) + "#{DIST_POINT_PKGS_FOLDER}/#{@filename}"

      local_path = Pathname.new local_file_path
      raise JSS::NoSuchItemError, "Local file '#{@local_file}' doesn't exist" unless local_path.exist?

      # should we zip it?
      if local_path.directory?
        begin
          # go to the same dir as the local file
          wd = Dir.pwd
          Dir.chdir local_path.parent

          # the contents of the zip file have to have the same name as the zip file itself (minus the .zip)
          # so temporarily rename the source
          local_path_to_upload = local_path.parent + @filename
          local_path.rename local_path_to_upload unless local_path_to_upload == local_path

          zipdir = Pathname.new "/tmp/rubyjsstmp-#{Time.new.strftime '%Y%m%d%H%M%S'}-#{$PROCESS_ID}"
          zipdir.mkpath
          zipdir.chmod 0o700
          zipfile = zipdir + (local_path_to_upload.basename.to_s + '.zip')

          raise 'There was a problem zipping the pkg bundle' unless system "/usr/bin/zip -qr '#{zipfile}' '#{local_path_to_upload}'"
        ensure
          # rename the source to the original name
          local_path_to_upload.rename local_path if local_path_to_upload.exist? && local_path_to_upload != local_path
          # go back where we started
          Dir.chdir wd
        end # begin

        # update our info
        local_path = zipfile
        destination = destination.to_s + '.zip'
        @filename = zipfile.basename.to_s
        @need_to_update = true
      end # if directory

      FileUtils.copy_entry local_path, destination

      if CHECKSUM_HASH_TYPES.keys.include? chksum
        @checksum_type = chksum
        @checksum = calculate_checksum local_file: local_path, type: chksum, unmount: false
        @need_to_update = true
      end
      update if @need_to_update
      mdp.unmount if unmount
    end
Upload a locally-readable file to the master distribution point.
 If the file is a directory (like a bundle .pk/.mpkg) it will be zipped before
 uploading and the @filename will be adjusted accordingly by adding a .zip extension

 The name of the local file doesn't matter, the file on the dist. point will
 use the @filename (possibly with .zip)

 If you'll be uploading several files you can specify unmount as false, and do it manually when all
 are finished with JSS::DistributionPoint.master_distribution_point.unmount

 @param local_file_path[String,Pathname] the local path to the file to be uploaded

 @param rw_pw[String,Symbol] the password for the read/write account on the master Distribution Point,
   or :prompt, or :stdin# where # is the line of stdin containing the password See {JSS::DistributionPoint#mount}

 @param unmount[Boolean] whether or not ot unount the distribution point when finished.

 @param chksum [String] the constants CHECKSUM_HASH_TYPE_SHA512 or
   CHECKSUM_HASH_TYPE_MD5. Anything else means don't calc.

 @return [void]