tballison commented on code in PR #2769: URL: https://github.com/apache/tika/pull/2769#discussion_r3096259641
########## tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-encode-module/src/main/java/org/apache/tika/parser/ocrencode/EncodeOCRConfig.java: ########## @@ -0,0 +1,167 @@ +/* + * 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.parser.ocrencode; + +import java.io.Serializable; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.HashSet; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.tika.exception.TikaException; + +/** + * Configuration for EncodeOCRParser. This class is not thread safe and must be + * synchronized externally. + * <p> + * This class will remember all set* field forever, and on + * {@link #cloneAndUpdate(EncodeOCRConfig)}, it will update all the fields that + * have been set on the "update" config. Create a new update config for each + * parse unless you're only changing the same field(s) with every parse. + */ +public class EncodeOCRConfig implements Serializable { + + private static final long serialVersionUID = -1761942486845717891L; + + private static final Logger LOG = LoggerFactory.getLogger( + EncodeOCRConfig.class + ); + + // Maximum file size to submit file to ocr. + private long maxFileSizeToOcr = Integer.MAX_VALUE; + // Minimum file size to submit file to ocr. + private long minFileSizeToOcr = 0; + private boolean skipOcr = false; + private int maxImagesToOcr = 50; + private Set<String> userConfigured = new HashSet<>(); Review Comment: We used to do this. We now get this for free via jackson. No need to track userconfigured. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
