ottlinger commented on code in PR #311: URL: https://github.com/apache/creadur-rat/pull/311#discussion_r1798486948
########## apache-rat-core/src/main/java/org/apache/rat/config/exclusion/fileProcessors/DescendingFileProcessor.java: ########## @@ -0,0 +1,133 @@ +/* + * 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.rat.config.exclusion.fileProcessors; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; + +import org.apache.commons.io.filefilter.DirectoryFileFilter; +import org.apache.commons.io.filefilter.NameFileFilter; +import org.apache.commons.lang3.StringUtils; +import org.apache.rat.config.exclusion.ExclusionUtils; +import org.apache.rat.config.exclusion.FileProcessor; +import org.apache.rat.document.impl.DocumentName; + +/** + * A FileProcessor that assumes the files contains the already formatted strings and just need to be + * localized for the fileName. + */ +public class DescendingFileProcessor implements FileProcessor { + /** The name of the file being processed */ + private final String fileName; + /** the predicate that will return {@code false} for any comment line in the file. */ + protected final Predicate<String> commentFilter; + /** The system dependant file name separator. e.g. "/" on linux. */ + protected final String separator; Review Comment: Should we use JDK-constants here instead of reinventing the wheel? e.g. https://docs.oracle.com/javase/8/docs/api/java/io/File.html's separator constants -- 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: dev-unsubscr...@creadur.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org