Skip to content

Commit 6feee8f

Browse files
author
Nicholas DiPiazza
committed
TIKA-4272: push config
1 parent 7933b09 commit 6feee8f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tika-pipes/tika-fetchers/tika-fetcher-microsoft-graph/src/main/java/org/apache/tika/pipes/fetchers/microsoftgraph/MicrosoftGraphFetcher.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.IOException;
2222
import java.io.InputStream;
2323
import java.nio.file.Files;
24+
import java.util.ArrayList;
2425
import java.util.Base64;
2526
import java.util.List;
2627
import java.util.Map;
@@ -72,7 +73,7 @@ public MicrosoftGraphFetcher(MicrosoftGraphFetcherConfig config) {
7273
*/
7374
@Field
7475
public void setThrottleSeconds(String commaDelimitedLongs) throws TikaConfigException {
75-
String[] longStrings = commaDelimitedLongs.split(",");
76+
String[] longStrings = (commaDelimitedLongs == null ? "" : commaDelimitedLongs).split(",");
7677
long[] seconds = new long[longStrings.length];
7778
for (int i = 0; i < longStrings.length; i++) {
7879
try {
@@ -120,7 +121,10 @@ public void setCertificatePassword(String certificatePassword) {
120121

121122
@Field
122123
public void setScopes(List<String> scopes) {
123-
this.config.setScopes(scopes);
124+
config.setScopes(new ArrayList<>(scopes));
125+
if (config.getScopes().isEmpty()) {
126+
config.getScopes().add("https://graph.microsoft.com/.default");
127+
}
124128
}
125129

126130
@Override

tika-pipes/tika-grpc/src/test/resources/tika-pipes-test-config.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
16-
--><properties>
16+
-->
17+
<properties>
1718
<async>
1819
<staleFetcherTimeoutSeconds>600</staleFetcherTimeoutSeconds>
1920
<staleFetcherDelaySeconds>60</staleFetcherDelaySeconds>
@@ -29,4 +30,6 @@
2930
<maxForEmitBatchBytes>-1</maxForEmitBatchBytes> <!-- disable emit -->
3031
</params>
3132
</pipes>
33+
<fetchers>
34+
</fetchers>
3235
</properties>

0 commit comments

Comments
 (0)