class Synqa::ContentLocation
Base class for a content location which consists of a base directory on a local or remote system.
Attributes
cachedContentFile[R]
The name of a file used to hold a cached content tree for this location (can optionally be specified)
Public Class Methods
new(cachedContentFile)
click to toggle source
# File lib/synqa.rb, line 754 def initialize(cachedContentFile) @cachedContentFile = cachedContentFile end
Public Instance Methods
clearCachedContentFile()
click to toggle source
Delete any existing cached content file
# File lib/synqa.rb, line 772 def clearCachedContentFile if cachedContentFile and File.exists?(cachedContentFile) puts " deleting cached content file #{cachedContentFile} ..." File.delete(cachedContentFile) end end
getCachedContentTree()
click to toggle source
Get the cached content tree (if any), read from the specified cached content file.
# File lib/synqa.rb, line 780 def getCachedContentTree file = getExistingCachedContentTreeFile if file return ContentTree.readFromFile(file) else return nil end end
getCachedContentTreeMapOfHashes()
click to toggle source
Read a map of file hashes (mapping from relative file name to hash value) from the specified cached content file
# File lib/synqa.rb, line 791 def getCachedContentTreeMapOfHashes file = getExistingCachedContentTreeFile if file puts "Reading cached file hashes from #{file} ..." return ContentTree.readMapOfHashesFromFile(file) else return [nil, {}] end end
getExistingCachedContentTreeFile()
click to toggle source
Get the cached content file name, if specified, and if the file exists
# File lib/synqa.rb, line 759 def getExistingCachedContentTreeFile if cachedContentFile == nil puts "No cached content file specified for location" return nil elsif File.exists?(cachedContentFile) return cachedContentFile else puts "Cached content file #{cachedContentFile} does not yet exist." return nil end end