This is an automated email from the ASF dual-hosted git repository.
ndipiazza pushed a commit to branch TIKA-4272-docker
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/TIKA-4272-docker by this push:
new b7613c83f TIKA-4272: get more of the pf4j changes and removal of shade
plugin changes in
b7613c83f is described below
commit b7613c83ff98e4a2237067a745717a93a207f6ad
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Sat Aug 24 11:56:22 2024 -0500
TIKA-4272: get more of the pf4j changes and removal of shade plugin changes
in
---
tika-core/pom.xml | 9 +-
.../tika/pipes/fetcher/config/FetcherConfig.java | 13 --
.../tika/pipes/fetcher/fs/FileSystemFetcher.java | 182 ---------------------
.../fetcher/fs/config/FileSystemFetcherConfig.java | 49 ------
.../apache/tika/pipes/fetcher/url/UrlFetcher.java | 53 ------
.../pipes/fetcher/url/config/UrlFetcherConfig.java | 28 ----
.../apache/tika/config/TikaPipesConfigTest.java | 14 --
.../pipes/fetcher/fs/FileSystemFetcherTest.java | 56 -------
tika-grpc/pom.xml | 5 +
.../org/apache/tika/pipes/grpc/TikaGrpcServer.java | 12 --
.../apache/tika/pipes/grpc/TikaGrpcServerImpl.java | 12 +-
.../pipes/grpc/exception/TikaGrpcException.java | 24 +++
.../plugin/ClasspathPluginPropertiesFinder.java | 16 ++
.../tika/pipes/grpc/plugin/GrpcPluginManager.java | 47 ++++++
.../tika/pipes/grpc/ExpiringFetcherStoreTest.java | 41 +++--
...PipesBiDirectionalStreamingIntegrationTest.java | 4 +-
.../apache/tika/pipes/grpc/TikaGrpcServerTest.java | 34 +++-
tika-pipes/tika-fetchers/pom.xml | 2 +-
.../tika-fetchers/tika-fetcher-az-blob/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../fetcher/azblob/config/AZBlobFetcherConfig.java | 2 +-
.../pom.xml | 4 +-
.../src/main}/assembly/assembly.xml | 0
.../tika/pipes/fetcher/fs/FileSystemFetcher.java | 0
.../pipes/fetcher/fs/FileSystemFetcherPlugin.java | 0
.../fetcher/fs/config/FileSystemFetcherConfig.java | 2 +-
.../src/main/resources/plugin.properties | 2 +-
tika-pipes/tika-fetchers/tika-fetcher-gcs/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../pipes/fetcher/gcs/config/GCSFetcherConfig.java | 2 +-
tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../fetcher/http/config/HttpFetcherConfig.java | 2 +-
.../tika-fetcher-microsoft-graph/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../config/MicrosoftGraphFetcherConfig.java | 2 +-
tika-pipes/tika-fetchers/tika-fetcher-s3/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../pipes/fetcher/s3/config/S3FetcherConfig.java | 2 +-
tika-pipes/tika-fetchers/tika-fetcher-url/pom.xml | 2 +-
.../src/{ => main}/assembly/assembly.xml | 0
.../pipes/fetcher/url/config/UrlFetcherConfig.java | 2 +-
.../tika/server/core/FetcherStreamFactory.java | 2 +-
43 files changed, 176 insertions(+), 459 deletions(-)
diff --git a/tika-core/pom.xml b/tika-core/pom.xml
index 172552a17..f5a9483c8 100644
--- a/tika-core/pom.xml
+++ b/tika-core/pom.xml
@@ -19,7 +19,8 @@
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -261,9 +262,9 @@
<jvmArgs>-Xmx256m</jvmArgs>
<timeout>240000</timeout>
<effort>max</effort>
- <failOnError>true</failOnError>
- </configuration>
- </plugin>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
diff --git
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/config/FetcherConfig.java
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/config/FetcherConfig.java
index 241211f36..e9df45189 100644
---
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/config/FetcherConfig.java
+++
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/config/FetcherConfig.java
@@ -16,9 +16,6 @@
*/
package org.apache.tika.pipes.fetcher.config;
-import java.io.IOException;
-import java.util.Properties;
-
public abstract class FetcherConfig {
private String fetcherId;
@@ -32,14 +29,4 @@ public abstract class FetcherConfig {
this.fetcherId = fetcherId;
return this;
}
-
- public static String getPluginIdForFetcherConfig(Class<?> clazz) {
- Properties properties = new Properties();
- try {
- properties.load(clazz.getResourceAsStream("/plugin.properties"));
- return properties.getProperty("plugin.id");
- } catch (IOException e) {
- throw new IllegalStateException("Cannot find plugin.properties for
plugin", e);
- }
- }
}
diff --git
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
deleted file mode 100644
index bc3c4cddd..000000000
---
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.pipes.fetcher.fs;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.nio.file.attribute.FileTime;
-import java.util.Date;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.tika.config.Field;
-import org.apache.tika.config.Initializable;
-import org.apache.tika.config.InitializableProblemHandler;
-import org.apache.tika.config.Param;
-import org.apache.tika.exception.TikaConfigException;
-import org.apache.tika.exception.TikaException;
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.FileSystem;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.metadata.Property;
-import org.apache.tika.metadata.TikaCoreProperties;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.pipes.fetcher.AbstractFetcher;
-import org.apache.tika.pipes.fetcher.fs.config.FileSystemFetcherConfig;
-
-public class FileSystemFetcher extends AbstractFetcher implements
Initializable {
- public FileSystemFetcher() {
- }
-
- public FileSystemFetcher(FileSystemFetcherConfig fileSystemFetcherConfig) {
- setBasePath(fileSystemFetcherConfig.getBasePath());
-
setExtractFileSystemMetadata(fileSystemFetcherConfig.isExtractFileSystemMetadata());
- }
-
- private static final Logger LOG =
LoggerFactory.getLogger(FileSystemFetcher.class);
-
- //Warning! basePath can be null!
- private Path basePath = null;
-
- private boolean extractFileSystemMetadata = false;
-
- static boolean isDescendant(Path root, Path descendant) {
- return descendant.toAbsolutePath().normalize()
- .startsWith(root.toAbsolutePath().normalize());
- }
-
- @Override
- public InputStream fetch(String fetchKey, Metadata metadata, ParseContext
parseContext) throws IOException, TikaException {
- if (fetchKey.contains("\u0000")) {
- throw new IllegalArgumentException("Path must not contain 'u0000'.
" +
- "Please review the life decisions that led you to
requesting " +
- "a file name with this character in it.");
- }
- Path p = null;
- if (basePath != null) {
- p = basePath.resolve(fetchKey);
- if (!p.toRealPath().startsWith(basePath.toRealPath())) {
- throw new IllegalArgumentException(
- "fetchKey must resolve to be a descendant of the
'basePath'");
- }
- } else {
- p = Paths.get(fetchKey);
- }
-
- metadata.set(TikaCoreProperties.SOURCE_PATH, fetchKey);
- updateFileSystemMetadata(p, metadata);
-
- if (!Files.isRegularFile(p)) {
- if (basePath != null && !Files.isDirectory(basePath)) {
- throw new IOException("BasePath is not a directory: " +
basePath);
- } else {
- throw new FileNotFoundException(p.toAbsolutePath().toString());
- }
- }
-
- return TikaInputStream.get(p, metadata);
- }
-
- private void updateFileSystemMetadata(Path p, Metadata metadata) throws
IOException {
- if (! extractFileSystemMetadata) {
- return;
- }
- BasicFileAttributes attrs = Files.readAttributes(p,
BasicFileAttributes.class);
- updateFileTime(FileSystem.CREATED, attrs.creationTime(), metadata);
- updateFileTime(FileSystem.MODIFIED, attrs.lastModifiedTime(),
metadata);
- updateFileTime(FileSystem.ACCESSED, attrs.lastAccessTime(), metadata);
- //TODO extract owner or group?
- }
-
- private void updateFileTime(Property property, FileTime fileTime, Metadata
metadata) {
- if (fileTime == null) {
- return;
- }
- metadata.set(property, new Date(fileTime.toMillis()));
- }
-
- /**
- *
- * @return the basePath or <code>null</code> if no base path was set
- */
- public Path getBasePath() {
- return basePath;
- }
-
- /**
- * Default behavior si that clients will send in relative paths, this
- * must be set to allow this fetcher to fetch the
- * full path.
- *
- * @param basePath
- */
- @Field
- public void setBasePath(String basePath) {
- this.basePath = Paths.get(basePath);
- }
-
- /**
- * Extract file system metadata (created, modified, accessed) when
fetching file.
- * The default is <code>false</code>.
- *
- * @param extractFileSystemMetadata
- */
- @Field
- public void setExtractFileSystemMetadata(boolean
extractFileSystemMetadata) {
- this.extractFileSystemMetadata = extractFileSystemMetadata;
- }
-
- @Override
- public void initialize(Map<String, Param> params) throws
TikaConfigException {
- //no-op
- }
-
- @Override
- public void checkInitialization(InitializableProblemHandler problemHandler)
- throws TikaConfigException {
- if (basePath == null || basePath.toString().trim().length() == 0) {
- LOG.warn("'basePath' has not been set. " +
- "This means that client code or clients can read from any
file that this " +
- "process has permissions to read. If you are running
tika-server, make " +
- "absolutely certain that you've locked down " +
- "access to tika-server and file-permissions for the
tika-server process.");
- return;
- }
- if (basePath.toString().startsWith("http://")) {
- throw new TikaConfigException("FileSystemFetcher only works with
local file systems. " +
- " Please use the tika-fetcher-http module for http calls");
- } else if (basePath.toString().startsWith("ftp://")) {
- throw new TikaConfigException("FileSystemFetcher only works with
local file systems. " +
- " Please consider contributing an ftp fetcher module");
- } else if (basePath.toString().startsWith("s3://")) {
- throw new TikaConfigException("FileSystemFetcher only works with
local file systems. " +
- " Please use the tika-fetcher-s3 module");
- }
-
- if (basePath.toAbsolutePath().toString().contains("\u0000")) {
- throw new TikaConfigException(
- "base path must not contain \u0000. " + "Seriously, what
were you thinking?");
- }
- }
-}
diff --git
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
deleted file mode 100644
index 52ec0ecaa..000000000
---
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.pipes.fetcher.fs.config;
-
-import org.apache.tika.pipes.fetcher.config.FetcherConfig;
-
-public class FileSystemFetcherConfig extends FetcherConfig {
-
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(FileSystemFetcherConfig.class);
-
- @Override
- public String getPluginId() {
- return PLUGIN_ID;
- }
- private String basePath;
- private boolean extractFileSystemMetadata;
-
- public String getBasePath() {
- return basePath;
- }
-
- public FileSystemFetcherConfig setBasePath(String basePath) {
- this.basePath = basePath;
- return this;
- }
-
- public boolean isExtractFileSystemMetadata() {
- return extractFileSystemMetadata;
- }
-
- public FileSystemFetcherConfig setExtractFileSystemMetadata(boolean
extractFileSystemMetadata) {
- this.extractFileSystemMetadata = extractFileSystemMetadata;
- return this;
- }
-}
diff --git
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/UrlFetcher.java
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/UrlFetcher.java
deleted file mode 100644
index 7692516cd..000000000
--- a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/UrlFetcher.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.pipes.fetcher.url;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Locale;
-
-import org.apache.tika.exception.TikaException;
-import org.apache.tika.io.TikaInputStream;
-import org.apache.tika.metadata.Metadata;
-import org.apache.tika.parser.ParseContext;
-import org.apache.tika.pipes.fetcher.AbstractFetcher;
-
-/**
- * Simple fetcher for URLs. This simply calls {@link TikaInputStream#get(URL)}.
- * This intentionally does not support fetching for files.
- * Please use the FileSystemFetcher for that. If you need more advanced
control (passwords,
- * timeouts, proxies, etc), please use the tika-fetcher-http module.
- */
-public class UrlFetcher extends AbstractFetcher {
-
- @Override
- public InputStream fetch(String fetchKey, Metadata metadata, ParseContext
parseContext) throws IOException, TikaException {
- if (fetchKey.contains("\u0000")) {
- throw new IllegalArgumentException("URL must not contain \u0000. "
+
- "Please review the life decisions that led you to
requesting " +
- "a URL with this character in it.");
- }
- if (fetchKey.toLowerCase(Locale.US).trim().startsWith("file:")) {
- throw new IllegalArgumentException(
- "The UrlFetcher does not fetch from file shares; " +
- "please use the FileSystemFetcher");
- }
- return TikaInputStream.get(new URL(fetchKey), metadata);
- }
-
-}
diff --git
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
b/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
deleted file mode 100644
index 9317c20fd..000000000
---
a/tika-core/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.pipes.fetcher.url.config;
-
-import org.apache.tika.pipes.fetcher.config.FetcherConfig;
-
-public class UrlFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID = "url-fetcher";
-
- @Override
- public String getPluginId() {
- return PLUGIN_ID;
- }
-}
diff --git
a/tika-core/src/test/java/org/apache/tika/config/TikaPipesConfigTest.java
b/tika-core/src/test/java/org/apache/tika/config/TikaPipesConfigTest.java
index 3ea1e538c..0f1ab2c90 100644
--- a/tika-core/src/test/java/org/apache/tika/config/TikaPipesConfigTest.java
+++ b/tika-core/src/test/java/org/apache/tika/config/TikaPipesConfigTest.java
@@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.List;
import org.junit.jupiter.api.Test;
@@ -34,24 +33,11 @@ import org.apache.tika.pipes.async.AsyncConfig;
import org.apache.tika.pipes.async.MockReporter;
import org.apache.tika.pipes.emitter.Emitter;
import org.apache.tika.pipes.emitter.EmitterManager;
-import org.apache.tika.pipes.fetcher.Fetcher;
import org.apache.tika.pipes.fetcher.FetcherManager;
-import org.apache.tika.pipes.fetcher.fs.FileSystemFetcher;
import org.apache.tika.pipes.pipesiterator.PipesIterator;
public class TikaPipesConfigTest extends AbstractTikaConfigTest {
//this handles tests for the newer pipes type configs.
-
- @Test
- public void testFetchers() throws Exception {
- FetcherManager m =
FetcherManager.load(getConfigFilePath("fetchers-config.xml"));
- Fetcher f1 = m.getFetcher("fs1");
- assertEquals(Paths.get("/my/base/path1"), ((FileSystemFetcher)
f1).getBasePath());
-
- Fetcher f2 = m.getFetcher("fs2");
- assertEquals(Paths.get("/my/base/path2"), ((FileSystemFetcher)
f2).getBasePath());
- }
-
@Test
public void testDuplicateFetchers() throws Exception {
//can't have two fetchers with the same name
diff --git
a/tika-core/src/test/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherTest.java
b/tika-core/src/test/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherTest.java
deleted file mode 100644
index 4d7e7068d..000000000
---
a/tika-core/src/test/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tika.pipes.fetcher.fs;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.nio.file.InvalidPathException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.junit.jupiter.api.Test;
-
-import org.apache.tika.config.InitializableProblemHandler;
-
-
-public class FileSystemFetcherTest {
-
- @Test
- public void testDescendant() throws Exception {
-
- Path root = Paths.get("/ab/cd/");
- Path descendant = root.resolve("ef/gh/ij.pdf");
- assertTrue(FileSystemFetcher.isDescendant(root, descendant));
-
- descendant = Paths.get("/cd/ef.pdf");
- assertFalse(FileSystemFetcher.isDescendant(root, descendant));
-
- descendant = root.resolve("../../ij.pdf");
- assertFalse(FileSystemFetcher.isDescendant(root, descendant));
- }
-
- @Test
- public void testNullByte() throws Exception {
- FileSystemFetcher f = new FileSystemFetcher();
- assertThrows(InvalidPathException.class, () -> {
- f.setBasePath("bad\u0000path");
- f.checkInitialization(InitializableProblemHandler.IGNORE);
- });
- }
-}
diff --git a/tika-grpc/pom.xml b/tika-grpc/pom.xml
index e8bdfeb66..99a851709 100644
--- a/tika-grpc/pom.xml
+++ b/tika-grpc/pom.xml
@@ -223,6 +223,11 @@
<artifactId>tika-fetcher-http</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-fetcher-file-system</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jsonSchema</artifactId>
diff --git
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
index 05a1efeae..d08754eed 100644
--- a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
+++ b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
@@ -35,13 +35,11 @@ import io.grpc.TlsServerCredentials;
import io.grpc.protobuf.services.HealthStatusManager;
import io.grpc.protobuf.services.ProtoReflectionService;
import org.pf4j.PluginManager;
-import org.pf4j.PluginWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.config.TikaConfigSerializer;
-import org.apache.tika.pipes.fetcher.Fetcher;
import org.apache.tika.pipes.grpc.plugin.GrpcPluginManager;
/**
@@ -110,16 +108,6 @@ public class TikaGrpcServer {
pluginManager.loadPlugins();
LOGGER.info("Loaded {} plugins", pluginManager.getPlugins().size());
pluginManager.startPlugins();
- for (PluginWrapper plugin : pluginManager.getStartedPlugins()) {
- LOGGER.info("Add-in " + plugin.getPluginId() + " : " +
plugin.getDescriptor() + " has started.");
- for (Class<?> extension :
pluginManager.getExtensionClasses(plugin.getPluginId())) {
- LOGGER.info(" Extension " + extension + " has been
registered -- {}", extension.isAssignableFrom(Fetcher.class));
- LOGGER.info(" or
-- {}", Fetcher.class.isAssignableFrom(extension));
- }
- }
- for (PluginWrapper plugin : pluginManager.getUnresolvedPlugins()) {
- LOGGER.warn("Add-in " + plugin.getPluginId() + " : " +
plugin.getDescriptor() + " is unresolved.");
- }
File tikaConfigFile = new File(tikaConfigXml.getAbsolutePath());
healthStatusManager.setStatus(TikaGrpcServer.class.getSimpleName(),
ServingStatus.SERVING);
server = Grpc
diff --git
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
index 1f4a81fa8..46e74d71a 100644
--- a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
+++ b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
@@ -220,7 +220,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
FetcherConfig fetcherConfig =
expiringFetcherStore.getFetcherAndLogAccess(request.getFetcherId());
if (fetcherConfig == null) {
- throw new RuntimeException(
+ throw new TikaGrpcException(
"Could not find fetcher with name " +
request.getFetcherId());
}
Metadata tikaMetadata = new Metadata();
@@ -258,7 +258,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
}
responseObserver.onNext(fetchReplyBuilder.build());
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new TikaGrpcException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
@@ -276,7 +276,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
saveFetcher(request.getFetcherId(), request.getPluginId(),
fetcherConfigMap, tikaParamsMap);
updateTikaConfig();
} catch (Exception e) {
- throw new RuntimeException(e);
+ throw new TikaGrpcException(e);
}
responseObserver.onNext(reply);
responseObserver.onCompleted();
@@ -389,7 +389,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
try {
updateTikaConfig();
} catch (Exception e) {
- throw new RuntimeException(e);
+ throw new TikaGrpcException(e);
}
}
responseObserver.onNext(DeleteFetcherReply.newBuilder().setSuccess(successfulDelete).build());
@@ -404,7 +404,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
JsonSchema jsonSchema =
JSON_SCHEMA_GENERATOR.generateSchema(fetcher.getClass());
builder.setFetcherConfigJsonSchema(OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema));
} catch (JsonProcessingException e) {
- throw new RuntimeException("Could not create json schema for
fetcher with plugin ID " + request.getPluginId(), e);
+ throw new TikaGrpcException("Could not create json schema for
fetcher with plugin ID " + request.getPluginId(), e);
}
responseObserver.onNext(builder.build());
responseObserver.onCompleted();
@@ -414,7 +414,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
return pluginManager.getExtensions(Fetcher.class, pluginId)
.stream()
.findFirst()
- .orElseThrow();
+ .orElseThrow(() -> new TikaGrpcException("Could
not find Fetcher extension for plugin " + pluginId));
}
@Override
diff --git
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/exception/TikaGrpcException.java
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/exception/TikaGrpcException.java
index 383eedb32..21a95f135 100644
---
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/exception/TikaGrpcException.java
+++
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/exception/TikaGrpcException.java
@@ -1,7 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.tika.pipes.grpc.exception;
public class TikaGrpcException extends RuntimeException {
+ public TikaGrpcException(Throwable cause) {
+ super(cause);
+ }
+
public TikaGrpcException(String message, Throwable cause) {
super(message, cause);
}
+
+ public TikaGrpcException(String message) {
+ super(message);
+ }
}
diff --git
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/ClasspathPluginPropertiesFinder.java
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/ClasspathPluginPropertiesFinder.java
index 472c1c975..2e9552d36 100644
---
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/ClasspathPluginPropertiesFinder.java
+++
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/ClasspathPluginPropertiesFinder.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.tika.pipes.grpc.plugin;
import java.nio.file.Path;
diff --git
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/GrpcPluginManager.java
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/GrpcPluginManager.java
index 21098dab5..53faa96b0 100644
---
a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/GrpcPluginManager.java
+++
b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/plugin/GrpcPluginManager.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.tika.pipes.grpc.plugin;
import java.nio.file.Path;
@@ -6,8 +22,15 @@ import java.util.List;
import org.pf4j.DefaultPluginManager;
import org.pf4j.PluginDescriptorFinder;
import org.pf4j.PluginLoader;
+import org.pf4j.PluginWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.tika.pipes.fetcher.Fetcher;
+import org.apache.tika.pipes.grpc.exception.TikaGrpcException;
public class GrpcPluginManager extends DefaultPluginManager {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(GrpcPluginManager.class);
public GrpcPluginManager() {
}
@@ -28,4 +51,28 @@ public class GrpcPluginManager extends DefaultPluginManager {
protected PluginLoader createPluginLoader() {
return super.createPluginLoader();
}
+
+ @Override
+ public void loadPlugins() {
+ super.loadPlugins();
+ LOGGER.info("Loaded {} plugins", getPlugins().size());
+ }
+
+ @Override
+ public void startPlugins() {
+ super.startPlugins();
+ for (PluginWrapper plugin : getStartedPlugins()) {
+ LOGGER.info("Add-in " + plugin.getPluginId() + " : " +
plugin.getDescriptor() + " has started.");
+ checkFetcherExtensions(plugin);
+ }
+ }
+
+ private void checkFetcherExtensions(PluginWrapper plugin) {
+ for (Class<?> extensionClass : getExtensionClasses(Fetcher.class,
plugin.getPluginId())) {
+ if (!Fetcher.class.isAssignableFrom(extensionClass)) {
+ throw new TikaGrpcException("Something is wrong with the
classpath. " + Fetcher.class.getName() + " should be assignable from " +
extensionClass.getName() + ". Did tika-core accidentally get in your plugin
lib?");
+ }
+ LOGGER.info(" Extension " + extensionClass + " has been
registered to plugin " + plugin.getPluginId());
+ }
+ }
}
diff --git
a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/ExpiringFetcherStoreTest.java
b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/ExpiringFetcherStoreTest.java
index 09ce85f98..5bafa6792 100644
---
a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/ExpiringFetcherStoreTest.java
+++
b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/ExpiringFetcherStoreTest.java
@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.time.Duration;
import org.awaitility.Awaitility;
+import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -35,31 +36,41 @@ class ExpiringFetcherStoreTest {
@Test
void createFetcher() {
try (ExpiringFetcherStore expiringFetcherStore = new
ExpiringFetcherStore(1, 5)) {
- AbstractFetcher fetcher = new AbstractFetcher() {
- @Override
- public InputStream fetch(String fetchKey, Metadata metadata,
ParseContext parseContext) {
- return null;
- }
- };
- fetcher.setName("nick");
- FetcherConfig config = new FetcherConfig() {
- };
- expiringFetcherStore.createFetcher(fetcher, config);
+ FetcherConfig config = getFetcherConfig();
+ String fetcherId = "nicksFetcherId";
+ expiringFetcherStore.createFetcher(fetcherId, config);
Assertions.assertNotNull(expiringFetcherStore
- .getFetchers()
- .get(fetcher.getName()));
+ .getFetcherConfigs()
+ .get(fetcherId));
Awaitility
.await()
.atMost(Duration.ofSeconds(60))
.until(() -> expiringFetcherStore
- .getFetchers()
- .get(fetcher.getName()) == null);
+ .getFetcherConfigs()
+ .get(fetcherId) == null);
assertNull(expiringFetcherStore
.getFetcherConfigs()
- .get(fetcher.getName()));
+ .get(fetcherId));
}
}
+
+ @NotNull
+ private static FetcherConfig getFetcherConfig() {
+ AbstractFetcher fetcher = new AbstractFetcher() {
+ @Override
+ public InputStream fetch(String fetchKey, Metadata metadata,
ParseContext parseContext) {
+ return null;
+ }
+ };
+ fetcher.setPluginId("nicksPlugin");
+ return new FetcherConfig() {
+ @Override
+ public String getPluginId() {
+ return fetcher.getPluginId();
+ }
+ };
+ }
}
diff --git
a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/PipesBiDirectionalStreamingIntegrationTest.java
b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/PipesBiDirectionalStreamingIntegrationTest.java
index e78110abb..cb4559bc5 100644
---
a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/PipesBiDirectionalStreamingIntegrationTest.java
+++
b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/PipesBiDirectionalStreamingIntegrationTest.java
@@ -55,7 +55,7 @@ import org.apache.tika.FetchAndParseRequest;
import org.apache.tika.SaveFetcherReply;
import org.apache.tika.SaveFetcherRequest;
import org.apache.tika.TikaGrpc;
-import org.apache.tika.pipes.fetcher.http.HttpFetcher;
+import org.apache.tika.pipes.fetcher.http.config.HttpFetcherConfig;
/**
* This test will start an HTTP server using jetty.
@@ -155,7 +155,7 @@ class PipesBiDirectionalStreamingIntegrationTest {
SaveFetcherRequest saveFetcherRequest = SaveFetcherRequest
.newBuilder()
.setFetcherId(httpFetcherId)
- .setFetcherClass(HttpFetcher.class.getName())
+ .setPluginId(HttpFetcherConfig.PLUGIN_ID)
.setFetcherConfigJson(OBJECT_MAPPER.writeValueAsString(ImmutableMap
.builder()
.put("requestTimeout", 30_000)
diff --git
a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java
b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java
index d5aebed67..ec9ace610 100644
--- a/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java
+++ b/tika-grpc/src/test/java/org/apache/tika/pipes/grpc/TikaGrpcServerTest.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.fail;
import java.io.File;
import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.time.LocalDateTime;
@@ -48,11 +49,12 @@ import io.grpc.inprocess.InProcessServerBuilder;
import io.grpc.stub.StreamObserver;
import org.apache.commons.io.FileUtils;
import org.jetbrains.annotations.NotNull;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.pf4j.DefaultPluginManager;
+import org.pf4j.PluginManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -67,6 +69,8 @@ import org.apache.tika.SaveFetcherRequest;
import org.apache.tika.TikaGrpc;
import org.apache.tika.pipes.PipesResult;
import org.apache.tika.pipes.fetcher.fs.FileSystemFetcher;
+import org.apache.tika.pipes.fetcher.fs.config.FileSystemFetcherConfig;
+import org.apache.tika.pipes.grpc.plugin.GrpcPluginManager;
@ExtendWith(GrpcCleanupExtension.class)
public class TikaGrpcServerTest {
@@ -85,6 +89,22 @@ public class TikaGrpcServerTest {
}
static final int NUM_FETCHERS_TO_CREATE = 10;
+ static PluginManager pluginManager;
+
+ @BeforeAll
+ static void loadPluginManager() throws Exception {
+ System.setProperty("pf4j.mode", "development"); // Development mode
lets you work from source dir easier.
+ Path fetchersPath = Path.of("..", "tika-pipes", "tika-fetchers");
+ LOG.info("Using pf4j in development mode using plugins dir: {}",
fetchersPath.toFile().getCanonicalPath());
+ pluginManager = new GrpcPluginManager(fetchersPath);
+ pluginManager.loadPlugins();
+ pluginManager.startPlugins();
+ }
+
+ @AfterAll
+ static void killPluginManager() {
+ pluginManager.stopPlugins();
+ }
@Test
public void testFetcherCrud(Resources resources) throws Exception {
@@ -94,7 +114,7 @@ public class TikaGrpcServerTest {
Server server = InProcessServerBuilder
.forName(serverName)
.directExecutor()
- .addService(new
TikaGrpcServerImpl(tikaConfigXml.getAbsolutePath(), new DefaultPluginManager()))
+ .addService(new
TikaGrpcServerImpl(tikaConfigXml.getAbsolutePath(), pluginManager))
.build()
.start();
resources.register(server, Duration.ofSeconds(10));
@@ -113,7 +133,7 @@ public class TikaGrpcServerTest {
SaveFetcherReply reply =
blockingStub.saveFetcher(SaveFetcherRequest
.newBuilder()
.setFetcherId(fetcherId)
- .setFetcherClass(FileSystemFetcher.class.getName())
+ .setPluginId(FileSystemFetcherConfig.PLUGIN_ID)
.setFetcherConfigJson(OBJECT_MAPPER.writeValueAsString(ImmutableMap
.builder()
.put("basePath", targetFolder)
@@ -128,7 +148,7 @@ public class TikaGrpcServerTest {
SaveFetcherReply reply =
blockingStub.saveFetcher(SaveFetcherRequest
.newBuilder()
.setFetcherId(fetcherId)
- .setFetcherClass(FileSystemFetcher.class.getName())
+ .setPluginId(FileSystemFetcherConfig.PLUGIN_ID)
.setFetcherConfigJson(OBJECT_MAPPER.writeValueAsString(ImmutableMap
.builder()
.put("basePath", targetFolder)
@@ -153,7 +173,7 @@ public class TikaGrpcServerTest {
.setFetcherId(fetcherId)
.build());
assertEquals(fetcherId, getFetcherReply.getFetcherId());
- assertEquals(FileSystemFetcher.class.getName(),
getFetcherReply.getFetcherClass());
+ assertEquals(FileSystemFetcherConfig.PLUGIN_ID,
getFetcherReply.getPluginId());
}
// delete fetchers
@@ -189,7 +209,7 @@ public class TikaGrpcServerTest {
Server server = InProcessServerBuilder
.forName(serverName)
.directExecutor()
- .addService(new
TikaGrpcServerImpl(tikaConfigXml.getAbsolutePath(), new DefaultPluginManager()))
+ .addService(new
TikaGrpcServerImpl(tikaConfigXml.getAbsolutePath(), pluginManager))
.build()
.start();
resources.register(server, Duration.ofSeconds(10));
@@ -207,7 +227,7 @@ public class TikaGrpcServerTest {
SaveFetcherReply reply = blockingStub.saveFetcher(SaveFetcherRequest
.newBuilder()
.setFetcherId(fetcherId)
- .setFetcherClass(FileSystemFetcher.class.getName())
+ .setPluginId(FileSystemFetcherConfig.PLUGIN_ID)
.setFetcherConfigJson(OBJECT_MAPPER.writeValueAsString(ImmutableMap
.builder()
.put("basePath", targetFolder)
diff --git a/tika-pipes/tika-fetchers/pom.xml b/tika-pipes/tika-fetchers/pom.xml
index 7c1c78a0d..5e271073b 100644
--- a/tika-pipes/tika-fetchers/pom.xml
+++ b/tika-pipes/tika-fetchers/pom.xml
@@ -38,7 +38,7 @@
<module>tika-fetcher-gcs</module>
<module>tika-fetcher-az-blob</module>
<module>tika-fetcher-microsoft-graph</module>
- <module>tika-fetcher-fs</module>
+ <module>tika-fetcher-file-system</module>
<module>tika-fetcher-url</module>
</modules>
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-az-blob/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-az-blob/pom.xml
index d262f7a11..0f1678635 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-az-blob/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-az-blob/pom.xml
@@ -61,7 +61,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/assembly/assembly.xml
similarity index 100%
rename from
tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/java/org/apache/tika/pipes/fetcher/azblob/config/AZBlobFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/java/org/apache/tika/pipes/fetcher/azblob/config/AZBlobFetcherConfig.java
index dbc03bb45..611389124 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/java/org/apache/tika/pipes/fetcher/azblob/config/AZBlobFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-az-blob/src/main/java/org/apache/tika/pipes/fetcher/azblob/config/AZBlobFetcherConfig.java
@@ -20,7 +20,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class AZBlobFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(AZBlobFetcherConfig.class);
+ public static final String PLUGIN_ID = "az-blob-fetcher";
@Override
public String getPluginId() {
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-fs/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/pom.xml
similarity index 95%
rename from tika-pipes/tika-fetchers/tika-fetcher-fs/pom.xml
rename to tika-pipes/tika-fetchers/tika-fetcher-file-system/pom.xml
index 2ac5bed9b..935b0a006 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-fs/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-file-system/pom.xml
@@ -26,7 +26,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>tika-fetcher-fs</artifactId>
+ <artifactId>tika-fetcher-file-system</artifactId>
<name>Apache Tika FS Fetcher</name>
<description>Apache Tika Pipes Fetcher for Local File System</description>
@@ -58,7 +58,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/assembly/assembly.xml
similarity index 100%
rename from tika-pipes/tika-fetchers/tika-fetcher-fs/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
similarity index 100%
rename from
tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
rename to
tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcher.java
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherPlugin.java
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherPlugin.java
similarity index 100%
rename from
tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherPlugin.java
rename to
tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/FileSystemFetcherPlugin.java
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
similarity index 94%
rename from
tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
rename to
tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
index 52ec0ecaa..ded6a9520 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/java/org/apache/tika/pipes/fetcher/fs/config/FileSystemFetcherConfig.java
@@ -20,7 +20,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class FileSystemFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(FileSystemFetcherConfig.class);
+ public static final String PLUGIN_ID = "file-system-fetcher";
@Override
public String getPluginId() {
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/resources/plugin.properties
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/resources/plugin.properties
similarity index 97%
rename from
tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/resources/plugin.properties
rename to
tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/resources/plugin.properties
index 41b443a51..3e6f63af2 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-fs/src/main/resources/plugin.properties
+++
b/tika-pipes/tika-fetchers/tika-fetcher-file-system/src/main/resources/plugin.properties
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-plugin.id=fs-fetcher
+plugin.id=file-system-fetcher
plugin.class=org.apache.tika.pipes.fetcher.fs.FileSystemFetcherPlugin
plugin.version=3.0.0-SNAPSHOT
plugin.provider=Local File System Fetcher
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-gcs/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-gcs/pom.xml
index 467f51d57..ab40f98b2 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-gcs/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-gcs/pom.xml
@@ -61,7 +61,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/assembly/assembly.xml
similarity index 100%
rename from tika-pipes/tika-fetchers/tika-fetcher-gcs/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/java/org/apache/tika/pipes/fetcher/gcs/config/GCSFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/java/org/apache/tika/pipes/fetcher/gcs/config/GCSFetcherConfig.java
index 49b94572c..5f6cf4d81 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/java/org/apache/tika/pipes/fetcher/gcs/config/GCSFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-gcs/src/main/java/org/apache/tika/pipes/fetcher/gcs/config/GCSFetcherConfig.java
@@ -20,7 +20,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class GCSFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(GCSFetcherConfig.class);
+ public static final String PLUGIN_ID = "gcs-fetcher";
@Override
public String getPluginId() {
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml
index 59e6ff5c6..268aee9d3 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-http/pom.xml
@@ -78,7 +78,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-http/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/assembly/assembly.xml
similarity index 100%
rename from tika-pipes/tika-fetchers/tika-fetcher-http/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-http/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java
index 76fdc6ace..0e43357da 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-http/src/main/java/org/apache/tika/pipes/fetcher/http/config/HttpFetcherConfig.java
@@ -23,7 +23,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class HttpFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(HttpFetcherConfig.class);
+ public static final String PLUGIN_ID = "http-fetcher";
@Override
public String getPluginId() {
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/pom.xml
index 135e0fc00..714813c91 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/pom.xml
@@ -145,7 +145,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/assembly/assembly.xml
similarity index 100%
rename from
tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
index 478790c68..1cb41f31c 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
@@ -23,7 +23,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class MicrosoftGraphFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(MicrosoftGraphFetcherConfig.class);
+ public static final String PLUGIN_ID = "microsoft-graph-fetcher";
@Override
public String getPluginId() {
return PLUGIN_ID;
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-s3/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-s3/pom.xml
index e24aba28b..ceae4f06f 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-s3/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-s3/pom.xml
@@ -65,7 +65,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-s3/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/assembly/assembly.xml
similarity index 100%
rename from tika-pipes/tika-fetchers/tika-fetcher-s3/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/java/org/apache/tika/pipes/fetcher/s3/config/S3FetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/java/org/apache/tika/pipes/fetcher/s3/config/S3FetcherConfig.java
index 24bd37893..110b4736b 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/java/org/apache/tika/pipes/fetcher/s3/config/S3FetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/java/org/apache/tika/pipes/fetcher/s3/config/S3FetcherConfig.java
@@ -20,7 +20,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class S3FetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(S3FetcherConfig.class);
+ public static final String PLUGIN_ID = "s3-fetcher";
@Override
public String getPluginId() {
diff --git a/tika-pipes/tika-fetchers/tika-fetcher-url/pom.xml
b/tika-pipes/tika-fetchers/tika-fetcher-url/pom.xml
index 05d129007..343d59e08 100644
--- a/tika-pipes/tika-fetchers/tika-fetcher-url/pom.xml
+++ b/tika-pipes/tika-fetchers/tika-fetcher-url/pom.xml
@@ -55,7 +55,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
-
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-url/src/assembly/assembly.xml
b/tika-pipes/tika-fetchers/tika-fetcher-url/src/main/assembly/assembly.xml
similarity index 100%
rename from tika-pipes/tika-fetchers/tika-fetcher-url/src/assembly/assembly.xml
rename to
tika-pipes/tika-fetchers/tika-fetcher-url/src/main/assembly/assembly.xml
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-url/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-url/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
index c5d553137..c4840ae83 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-url/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-url/src/main/java/org/apache/tika/pipes/fetcher/url/config/UrlFetcherConfig.java
@@ -20,7 +20,7 @@ import org.apache.tika.pipes.fetcher.config.FetcherConfig;
public class UrlFetcherConfig extends FetcherConfig {
- public static final String PLUGIN_ID =
getPluginIdForFetcherConfig(UrlFetcherConfig.class);
+ public static final String PLUGIN_ID = "url-fetcher";
@Override
public String getPluginId() {
diff --git
a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/FetcherStreamFactory.java
b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/FetcherStreamFactory.java
index e7f1d210e..77943bca1 100644
---
a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/FetcherStreamFactory.java
+++
b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/FetcherStreamFactory.java
@@ -108,7 +108,7 @@ public class FetcherStreamFactory implements
InputStreamFactory {
Fetcher fetcher = fetcherManager.getFetcher(fetcherName);
if (fetchRangeStart > -1 && fetchRangeEnd > -1 && !(fetcher
instanceof RangeFetcher)) {
throw new IllegalArgumentException(
- "Can't call a fetch with a range on a fetcher
that" + " is not a RangeFetcher: name=" + fetcher.getName() + " class=" +
fetcher.getClass());
+ "Can't call a fetch with a range on a fetcher
that" + " is not a RangeFetcher: pluginId=" + fetcher.getPluginId() + " class="
+ fetcher.getClass());
}
return fetcher.fetch(fetchKey, metadata, parseContext);
} catch (TikaException e) {