You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/06/02 14:17:30 UTC

[GitHub] [maven-shared-utils] kwin commented on a change in pull request #54: rework directory scanner to ensure it can enforce exclusions and it uses path

kwin commented on a change in pull request #54:
URL: https://github.com/apache/maven-shared-utils/pull/54#discussion_r644008249



##########
File path: src/main/java/org/apache/maven/shared/utils/io/conductor/EnforceExcludesOverIncludes.java
##########
@@ -0,0 +1,58 @@
+package org.apache.maven.shared.utils.io.conductor;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.shared.utils.io.DirectoryScanner;
+import org.apache.maven.shared.utils.io.MatchPatterns;
+import org.apache.maven.shared.utils.io.ScanConductor;
+import org.apache.maven.shared.utils.io.ScannerAware;
+
+import java.io.File;
+
+/**
+ * If an exclude is defined on a folder it does not visit of the children
+ * even if some include can match children.
+ */
+public class EnforceExcludesOverIncludes implements ScanConductor, ScannerAware

Review comment:
       Wouldn't it make class if this would directly implement https://docs.oracle.com/javase/7/docs/api/java/nio/file/DirectoryStream.Filter.html instead? That way one could get rid of the ScanConductor interface...




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org