Class: Ddr::Extraction::Adapters::TikaAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/ddr/extraction/adapters/tika_adapter.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Adapter

config

Class Attribute Details

.checksumObject

Tika distribution checksum



30
31
32
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 30

def checksum
  @checksum
end

.checksum_typeObject

Tika distribution checksum type



33
34
35
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 33

def checksum_type
  @checksum_type
end

.commandObject

Base command



24
25
26
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 24

def command
  @command
end

.download_urlObject

URL to download distribution



27
28
29
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 27

def download_url
  @download_url
end

.pathObject

Path to tika-app.jar



21
22
23
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 21

def path
  @path
end

.portObject

Tika server port (optional, required for server)



36
37
38
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 36

def port
  @port
end

.versionObject

Tika version



18
19
20
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 18

def version
  @version
end

Instance Method Details

#extract_text(file) ⇒ IO

Extract text from file

Parameters:

  • file (String)

    path to file from which to extract text

Returns:

  • (IO)


12
13
14
# File 'lib/ddr/extraction/adapters/tika_adapter.rb', line 12

def extract_text(file)
  IO.popen(["java", "-jar", self.class.path, "--text", file])
end