Sha256: 344f5af492634c68b70aa7232067e72ad90e95f9b4228140a088e274bcf7195c

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 Bytes

Contents

module Dor

  # Rename the druid trees  at the end of the accessionWF in order to be cleaned/deleted later.
  class ArchiveWorkspaceService

    def self.archive_workspace_druid_tree(druid, version, workspace_root)
      
      druid_tree_path = DruidTools::Druid.new(druid, workspace_root).pathname.to_s
      
      raise "The archived directory #{druid_tree_path}_v#{version} already existed." if  File.exists?("#{druid_tree_path}_v#{version}") 
      
      if File.exists?(druid_tree_path) 
        FileUtils.mv(druid_tree_path, "#{druid_tree_path}_v#{version}")
      end #Else is a truncated tree where we shouldn't do anything

    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dor-services-4.12.2 lib/dor/services/archive_workspace_service.rb
dor-services-4.11.1 lib/dor/services/archive_workspace_service.rb
dor-services-4.11.0 lib/dor/services/archive_workspace_service.rb