Method: Chef::Provider::File#load_current_resource

Defined in:
lib/chef/provider/file.rb

#load_current_resourceObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/chef/provider/file.rb', line 128

def load_current_resource
  # Every child should be specifying their own constructor, so this
  # should only be run in the file case.
  @current_resource ||= Chef::Resource::File.new(@new_resource.name)
  @new_resource.path.gsub!(/\\/, "/") # for Windows
  @current_resource.path(@new_resource.path)
  if !::File.directory?(@new_resource.path)
    if ::File.exist?(@new_resource.path)
      if @action != :create_if_missing  
        @current_resource.checksum(checksum(@new_resource.path))
      end
    end
  end
  setup_acl

  @current_resource
end