Class: Pho::FileManagement::RDFManager

Inherits:
AbstractFileManager show all
Defined in:
lib/pho/rdf_collection.rb

Overview

Provides a simple mechanism for managing a directory of RDF/XML documents and uploading them to platform store.

Allows a collection to be mirrored into the platform

Direct Known Subclasses

RDFCollection

Constant Summary collapse

RDF =
"rdf".freeze
TTL =
"ttl".freeze
NT =
"nt".freeze
ALL_RDF =
[RDF, TTL, NT]

Constants inherited from AbstractFileManager

AbstractFileManager::FAIL, AbstractFileManager::OK

Instance Attribute Summary

Attributes inherited from AbstractFileManager

#dir, #store

Instance Method Summary collapse

Methods inherited from AbstractFileManager

#failures, #get_fail_file_for, #get_ok_file_for, #new_files, #reset, #retry_failures, #successes, #summary

Constructor Details

#initialize(store, dir, rdf_suffixes = ALL_RDF, ok_suffix = OK, fail_suffix = FAIL, sleep = 1) ⇒ RDFManager

Returns a new instance of RDFManager.



17
18
19
20
# File 'lib/pho/rdf_collection.rb', line 17

def initialize(store, dir, rdf_suffixes=ALL_RDF, ok_suffix=OK, fail_suffix=FAIL, sleep=1)
  super(store, dir, ok_suffix, fail_suffix, sleep)
  @rdf_suffixes = rdf_suffixes
end

Instance Method Details

#list(recursive = false) ⇒ Object

List files being managed



23
24
25
# File 'lib/pho/rdf_collection.rb', line 23

def list(recursive=false)
    return Dir.glob( File.join(@dir, "*.\{#{ @rdf_suffixes.join(",") }\}") )  
end