# This will not download Java from anywhere.
# Take the path to a compress tarball containing Java
# Extract Java to destination directory

require 'chef/resource/directory'

module ChefJava
  module Instance
    class Tar

      def initialize(path, options, action)
        @path = path
        @options = options
        @action = action
      end

      def install
      end

      def remove
      end

      private

      # TODO: Memoize this.
      def manage_directory
        dir = Chef::Directory.new(@path)
        dir.owner 'root'
        dir.group 'root'
        dir.mode 00755
        dir.run_action(:create)
      end

      #
      def tar
      end

      def decompress
      end

    end
  end
end
# This will not download Java from anywhere.
# Take the path to a compress tarball containing Java
# Extract Java to destination directory

require 'chef/resource/directory'
require_relative 'tar_helper'

module ChefJava
  module Instance
    class Tar

      def initialize(options)
        @options = options
      end

      def install
        extract_tar
      end

      def remove
        remove_extracted_tar
      end

      private

      def archive
        @options[:source]
      end

      def destination
        @options[:destination]
      end

      #
      def extract_tar
        ChefJava::Helpers::Tar.new(archive, destination)
      end

      def remove_extracted_tar
        FileUtils.rm_rf(destination)
      end
    end
  end
end
Make our instance helper to dealing with tar files use our tar_helper. Remove the extracted mess if requested.
Make our instance helper to dealing with tar files use our tar_helper. Remove the extracted mess if requested.
