This is an automated email from the ASF dual-hosted git repository.
ndipiazza pushed a commit to branch tika-grpc-3x-features
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/tika-grpc-3x-features by this
push:
new 6feee8f7b TIKA-4272: push config
6feee8f7b is described below
commit 6feee8f7b1f863152be5b3686d0a7b8bd78fa4f2
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Wed Nov 6 19:12:07 2024 -0600
TIKA-4272: push config
---
.../tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java | 8 ++++++--
.../tika-grpc/src/test/resources/tika-pipes-test-config.xml | 5 ++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java
index 6733fb3a7..b9f6ceafa 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
+import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
@@ -72,7 +73,7 @@ public class MicrosoftGraphFetcher extends AbstractFetcher
implements Initializa
*/
@Field
public void setThrottleSeconds(String commaDelimitedLongs) throws
TikaConfigException {
- String[] longStrings = commaDelimitedLongs.split(",");
+ String[] longStrings = (commaDelimitedLongs == null ? "" :
commaDelimitedLongs).split(",");
long[] seconds = new long[longStrings.length];
for (int i = 0; i < longStrings.length; i++) {
try {
@@ -120,7 +121,10 @@ public class MicrosoftGraphFetcher extends AbstractFetcher
implements Initializa
@Field
public void setScopes(List<String> scopes) {
- this.config.setScopes(scopes);
+ config.setScopes(new ArrayList<>(scopes));
+ if (config.getScopes().isEmpty()) {
+ config.getScopes().add("https://graph.microsoft.com/.default");
+ }
}
@Override
diff --git a/tika-pipes/tika-grpc/src/test/resources/tika-pipes-test-config.xml
b/tika-pipes/tika-grpc/src/test/resources/tika-pipes-test-config.xml
index da42b2141..e4006edb3 100644
--- a/tika-pipes/tika-grpc/src/test/resources/tika-pipes-test-config.xml
+++ b/tika-pipes/tika-grpc/src/test/resources/tika-pipes-test-config.xml
@@ -13,7 +13,8 @@
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.
---><properties>
+-->
+<properties>
<async>
<staleFetcherTimeoutSeconds>600</staleFetcherTimeoutSeconds>
<staleFetcherDelaySeconds>60</staleFetcherDelaySeconds>
@@ -29,4 +30,6 @@
<maxForEmitBatchBytes>-1</maxForEmitBatchBytes> <!-- disable emit -->
</params>
</pipes>
+ <fetchers>
+ </fetchers>
</properties>