Skip to content

Commit a909fd9

Browse files
authored
Merge pull request #35 from mpdude/fetcher
Fix fetcher name checking, simplify transition from Tika 1.x to 2.x
2 parents cbba9b4 + fd7c66c commit a909fd9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/Clients/WebClient.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,6 @@ public function getFetcherName(): ?string
232232
*/
233233
public function setFetcherName(string $fetcherName): self
234234
{
235-
if(!in_array($fetcherName, ['FileSystemFetcher', 'HttpFetcher', 'S3Fetcher', 'GCSFetcher', 'SolrFetcher']))
236-
{
237-
throw new Exception("Fetcher name $fetcherName is invalid, see https://cwiki.apache.org/confluence/display/TIKA/tika-pipes");
238-
}
239-
240235
$this->fetcherName = $fetcherName;
241236

242237
return $this;
@@ -662,13 +657,10 @@ protected function getParameters(string $type, string $file = null): array
662657
{
663658
if($this->fetcherName)
664659
{
665-
$headers[] = "fetcherName:$this->fetcherName";
666-
$headers[] = "fetchKey:$file";
667-
}
668-
else
669-
{
670-
$headers[] = "fileUrl:$file";
660+
$headers[] = "fetcherName: $this->fetcherName";
661+
$headers[] = "fetchKey: $file";
671662
}
663+
$headers[] = "fileUrl: $file";
672664
}
673665

674666
switch($type)

0 commit comments

Comments
 (0)