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 e7f39f0b6 fix wrongly named config class
e7f39f0b6 is described below
commit e7f39f0b6cf9a1204bfb9bc3b20884d343bee426
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Wed Jul 10 20:57:57 2024 -0500
fix wrongly named config class
---
.../microsoftgraph/MicrosoftGraphFetcher.java | 19 ++++++++++---------
...erConfig.java => MicrosoftGraphFetcherConfig.java} | 10 +++++-----
.../microsoftgraph/MicrosoftGraphFetcherTest.java | 4 ++--
3 files changed, 17 insertions(+), 16 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 61b486399..3c27795d3 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
@@ -38,7 +38,7 @@ import org.apache.tika.parser.ParseContext;
import org.apache.tika.pipes.fetcher.AbstractFetcher;
import
org.apache.tika.pipes.fetchers.microsoftgraph.config.ClientCertificateCredentialsConfig;
import
org.apache.tika.pipes.fetchers.microsoftgraph.config.ClientSecretCredentialsConfig;
-import
org.apache.tika.pipes.fetchers.microsoftgraph.config.MsGraphFetcherConfig;
+import
org.apache.tika.pipes.fetchers.microsoftgraph.config.MicrosoftGraphFetcherConfig;
/**
* Fetches files from Microsoft Graph API.
@@ -47,15 +47,15 @@ import
org.apache.tika.pipes.fetchers.microsoftgraph.config.MsGraphFetcherConfig
public class MicrosoftGraphFetcher extends AbstractFetcher implements
Initializable {
private static final Logger LOGGER =
LoggerFactory.getLogger(MicrosoftGraphFetcher.class);
private GraphServiceClient graphClient;
- private MsGraphFetcherConfig msGraphFetcherConfig;
+ private MicrosoftGraphFetcherConfig microsoftGraphFetcherConfig;
private long[] throttleSeconds;
public MicrosoftGraphFetcher() {
}
- public MicrosoftGraphFetcher(MsGraphFetcherConfig msGraphFetcherConfig) {
- this.msGraphFetcherConfig = msGraphFetcherConfig;
+ public MicrosoftGraphFetcher(MicrosoftGraphFetcherConfig
microsoftGraphFetcherConfig) {
+ this.microsoftGraphFetcherConfig = microsoftGraphFetcherConfig;
}
/**
@@ -84,19 +84,20 @@ public class MicrosoftGraphFetcher extends AbstractFetcher
implements Initializa
@Override
public void initialize(Map<String, Param> map) {
- String[] scopes = msGraphFetcherConfig.getScopes().toArray(new
String[0]);
- if (msGraphFetcherConfig.getCredentials() instanceof
ClientCertificateCredentialsConfig) {
+ String[] scopes = microsoftGraphFetcherConfig
+ .getScopes().toArray(new String[0]);
+ if (microsoftGraphFetcherConfig.getCredentials() instanceof
ClientCertificateCredentialsConfig) {
ClientCertificateCredentialsConfig credentials =
- (ClientCertificateCredentialsConfig)
msGraphFetcherConfig.getCredentials();
+ (ClientCertificateCredentialsConfig)
microsoftGraphFetcherConfig.getCredentials();
graphClient = new GraphServiceClient(
new
ClientCertificateCredentialBuilder().clientId(credentials.getClientId())
.tenantId(credentials.getTenantId()).pfxCertificate(
new
ByteArrayInputStream(credentials.getCertificateBytes()))
.clientCertificatePassword(credentials.getCertificatePassword())
.build(), scopes);
- } else if (msGraphFetcherConfig.getCredentials() instanceof
ClientSecretCredentialsConfig) {
+ } else if (microsoftGraphFetcherConfig.getCredentials() instanceof
ClientSecretCredentialsConfig) {
ClientSecretCredentialsConfig credentials =
- (ClientSecretCredentialsConfig)
msGraphFetcherConfig.getCredentials();
+ (ClientSecretCredentialsConfig)
microsoftGraphFetcherConfig.getCredentials();
graphClient = new GraphServiceClient(
new
ClientSecretCredentialBuilder().tenantId(credentials.getTenantId())
.clientId(credentials.getClientId())
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MsGraphFetcherConfig.java
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
similarity index 81%
rename from
tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MsGraphFetcherConfig.java
rename to
tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
index fe72c8c31..04a43e000 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MsGraphFetcherConfig.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/config/MicrosoftGraphFetcherConfig.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.apache.tika.pipes.fetcher.config.AbstractConfig;
-public class MsGraphFetcherConfig extends AbstractConfig {
+public class MicrosoftGraphFetcherConfig extends AbstractConfig {
private long[] throttleSeconds;
private boolean spoolToTemp;
private AadCredentialConfigBase credentials;
@@ -32,7 +32,7 @@ public class MsGraphFetcherConfig extends AbstractConfig {
return spoolToTemp;
}
- public MsGraphFetcherConfig setSpoolToTemp(boolean spoolToTemp) {
+ public MicrosoftGraphFetcherConfig setSpoolToTemp(boolean spoolToTemp) {
this.spoolToTemp = spoolToTemp;
return this;
}
@@ -41,7 +41,7 @@ public class MsGraphFetcherConfig extends AbstractConfig {
return throttleSeconds;
}
- public MsGraphFetcherConfig setThrottleSeconds(long[] throttleSeconds) {
+ public MicrosoftGraphFetcherConfig setThrottleSeconds(long[]
throttleSeconds) {
this.throttleSeconds = throttleSeconds;
return this;
}
@@ -50,7 +50,7 @@ public class MsGraphFetcherConfig extends AbstractConfig {
return credentials;
}
- public MsGraphFetcherConfig setCredentials(AadCredentialConfigBase
credentials) {
+ public MicrosoftGraphFetcherConfig setCredentials(AadCredentialConfigBase
credentials) {
this.credentials = credentials;
return this;
}
@@ -59,7 +59,7 @@ public class MsGraphFetcherConfig extends AbstractConfig {
return scopes;
}
- public MsGraphFetcherConfig setScopes(List<String> scopes) {
+ public MicrosoftGraphFetcherConfig setScopes(List<String> scopes) {
this.scopes = scopes;
return this;
}
diff --git
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/test/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcherTest.java
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/test/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcherTest.java
index 6a2e71855..7dda9fb7a 100644
---
a/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/test/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcherTest.java
+++
b/tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/test/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcherTest.java
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.ParseContext;
import
org.apache.tika.pipes.fetchers.microsoftgraph.config.ClientCertificateCredentialsConfig;
-import
org.apache.tika.pipes.fetchers.microsoftgraph.config.MsGraphFetcherConfig;
+import
org.apache.tika.pipes.fetchers.microsoftgraph.config.MicrosoftGraphFetcherConfig;
@ExtendWith(MockitoExtension.class)
class MicrosoftGraphFetcherTest {
@@ -59,7 +59,7 @@ class MicrosoftGraphFetcherTest {
GraphServiceClient graphClient;
@Spy
@SuppressWarnings("unused")
- MsGraphFetcherConfig msGraphFetcherConfig = new
MsGraphFetcherConfig().setCredentials(
+ MicrosoftGraphFetcherConfig msGraphFetcherConfig = new
MicrosoftGraphFetcherConfig().setCredentials(
new
ClientCertificateCredentialsConfig().setCertificateBytes(certificateBytes)
.setCertificatePassword(certificatePassword).setClientId(clientId)
.setTenantId(tenantId)).setScopes(Collections.singletonList(".default"));