lib/jss/api_object/package.rb
def update_master_filename(old_file_name, new_file_name, rw_pw, unmount = true, dist_point: nil)
      raise JSS::NoSuchItemError, "#{old_file_name} does not exist in the jss." unless @in_jss
      dp = self.class.fetch_dist_point(dist_point, api: @api)

      pkgs_dir = dp.mount(rw_pw, :rw) + DIST_POINT_PKGS_FOLDER.to_s
      old_file = pkgs_dir + old_file_name
      raise JSS::NoSuchItemError, "File not found on the master distribution point at #{DIST_POINT_PKGS_FOLDER}/#{old_file_name}." unless \
        old_file.exist?

      new_file = pkgs_dir + new_file_name
      # use the extension of the original file.
      new_file = pkgs_dir + (new_file_name + old_file.extname) if new_file.extname.empty?

      old_file.rename new_file
      dp.unmount if unmount
      nil
    end
# Change the name of a package file on the master distribution point.
#
# @param new_file_name[String]
#
# @param old_file_name[default: @filename, String]
#
# @param unmount[Boolean] whether or not ot unount the distribution point when finished.
#
# @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 dist_point [String,Integer] the name or id of the distribution
#   point to use. Defaults to the Master Dist. Point
#
# @return [nil]
#
Change the name of a package file on the master distribution point.
Change the name of a package file on the master distribution point .
def update_master_filename(old_file_name, new_file_name, rw_pw, unmount = true, dist_point: nil)
      raise JSS::NoSuchItemError, "#{old_file_name} does not exist in the jss." unless @in_jss
      dp = self.class.fetch_dist_point(dist_point, api: @api)
      pkgs_dir = dp.mount(rw_pw, :rw) + DIST_POINT_PKGS_FOLDER.to_s
      old_file = pkgs_dir + old_file_name
      raise JSS::NoSuchItemError, "File not found on the master distribution point at #{DIST_POINT_PKGS_FOLDER}/#{old_file_name}." unless \
        old_file.exist?
      new_file = pkgs_dir + new_file_name
      new_file = pkgs_dir + (new_file_name + old_file.extname) if new_file.extname.empty?
      old_file.rename new_file
      dp.unmount if unmount
      nil
    end
def update_master_filename ( old_file_name , new_file_name , rw_pw , unmount = true , dist_point : nil ) raise JSS :: NoSuchItemError , "#{old_file_name} does not exist in the jss." unless @in_jss dp = self . class . fetch_dist_point ( dist_point , api : @api ) pkgs_dir = dp . mount ( rw_pw , :rw ) + DIST_POINT_PKGS_FOLDER . to_s old_file = pkgs_dir + old_file_name raise JSS :: NoSuchItemError , "File not found on the master distribution point at #{DIST_POINT_PKGS_FOLDER}/#{old_file_name}." unless old_file . exist? new_file = pkgs_dir + new_file_name new_file = pkgs_dir + ( new_file_name + old_file . extname ) if new_file . extname . empty? old_file . rename new_file dp . unmount if unmount nil end
Change the name of a package file on the master distribution point.
Change the name of a package file on the master distribution point .
# use the extension of the original file.
None
nil
old_file_name
new_file_name
rw_pw
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}
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 }
unmount
whether or not ot unount the distribution point when finished.
whether or not ot unount the distribution point when finished .
dist_point
the name or id of the distribution point to use. Defaults to the Master Dist. Point
the name or id of the distribution point to use . Defaults to the Master Dist . Point
None