Class: LogicalConstruct::ResolutionServer::ResolutionMethods::LocalStorage

Inherits:
ResolutionMethod
  • Object
show all
Defined in:
lib/logical-construct/target/plan-records.rb

Constant Summary

Constants included from Protocol::PlanValidation

Protocol::PlanValidation::BIG_CHUNK

Instance Attribute Summary

Attributes inherited from ResolutionMethod

#state

Instance Method Summary collapse

Methods inherited from ResolutionMethod

#exists?, #initialize, register

Methods included from Protocol::PlanValidation

#check_digest, #chunk_size, #digest, #file_checksum, #generate_checksum, #realpath

Constructor Details

This class inherits a constructor from LogicalConstruct::ResolutionServer::ResolutionMethods::ResolutionMethod

Instance Method Details

#runObject



305
306
307
308
309
310
311
312
# File 'lib/logical-construct/target/plan-records.rb', line 305

def run
  stored_path = state.storage_path_for(state.record.filehash)
  received_path = state.received_path

  if exists?(stored_path) and not (exists?(received_path) or symlink?(received_path))
    FileUtils.symlink(stored_path, received_path)
  end
end