# class Chef::Resource::File

### Attributes

checksum[W]

### Public Class Methods

new(name, run_context=nil) click to toggle source
Calls superclass method Chef::Resource.new

    # File lib/chef/resource/file.rb, line 43
    def initialize(name, run_context=nil)
      super
      @resource_name = :file
      @path = name
      @backup = 5
      @action = "create"
      @allowed_actions.push(:create, :delete, :touch, :create_if_missing)
      @provider = Chef::Provider::File
      @atomic_update = Chef::Config[:file_atomic_update]
      @force_unlink = false
      @manage_symlink_source = nil
      @diff = nil
      @sensitive = false
    end

### Public Instance Methods

atomic_update(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 98
    def atomic_update(arg=nil)
      set_or_return(
        :atomic_update,
        arg,
        :kind_of => [ TrueClass, FalseClass ]
      )
    end

backup(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 66
    def backup(arg=nil)
      set_or_return(
        :backup,
        arg,
        :kind_of => [ Integer, FalseClass ]
      )
    end

checksum(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 74
    def checksum(arg=nil)
      set_or_return(
        :checksum,
        arg,
        :regex => /^[a-zA-Z0-9]{64}$/
      )
    end

content(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 58
    def content(arg=nil)
      set_or_return(
        :content,
        arg,
        :kind_of => String
      )
    end

diff(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 90
    def diff(arg=nil)
      set_or_return(
        :diff,
        arg,
        :kind_of => String
      )
    end

force_unlink(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 106
    def force_unlink(arg=nil)
      set_or_return(
        :force_unlink,
        arg,
        :kind_of => [ TrueClass, FalseClass ]
      )
    end

manage_symlink_source(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 114
    def manage_symlink_source(arg=nil)
      set_or_return(
        :manage_symlink_source,
        arg,
        :kind_of => [ TrueClass, FalseClass ]
      )
    end

path(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 82
    def path(arg=nil)
      set_or_return(
        :path,
        arg,
        :kind_of => String
      )
    end

sensitive(arg=nil) click to toggle source

    # File lib/chef/resource/file.rb, line 122
    def sensitive(arg=nil)
      set_or_return(
        :sensitive,
        arg,
        :kind_of => [ TrueClass, FalseClass ]
      )
    end