10
10
11
11
package org .junit .platform .commons .support .scanning ;
12
12
13
- import static org .apiguardian .api .API .Status .DEPRECATED ;
14
13
import static org .apiguardian .api .API .Status .MAINTAINED ;
15
14
16
15
import java .net .URI ;
17
16
import java .util .List ;
18
- import java .util .function .Predicate ;
19
17
20
18
import org .apiguardian .api .API ;
21
19
import org .junit .platform .commons .io .Resource ;
@@ -64,54 +62,6 @@ public interface ClasspathScanner {
64
62
*/
65
63
List <Class <?>> scanForClassesInClasspathRoot (URI root , ClassFilter classFilter );
66
64
67
- /**
68
- * Find all {@linkplain org.junit.platform.commons.support.Resource resources} in the supplied classpath {@code root}
69
- * that match the specified {@code resourceFilter} predicate.
70
- *
71
- * <p>The classpath scanning algorithm searches recursively in subpackages
72
- * beginning with the root of the classpath.
73
- *
74
- * @param basePackageName the name of the base package in which to start
75
- * scanning; must not be {@code null} and must be valid in terms of Java
76
- * syntax
77
- * @param resourceFilter the resource type filter; never {@code null}
78
- * @return a list of all such resources found; never {@code null}
79
- * but potentially empty
80
- * @deprecated Please implement
81
- * {@link #scanForResourcesInPackage(String, ResourceFilter)} instead
82
- */
83
- @ API (status = DEPRECATED , since = "6.0" )
84
- @ Deprecated (since = "6.0" , forRemoval = true )
85
- @ SuppressWarnings ({ "removal" , "unused" })
86
- default List <org .junit .platform .commons .support .Resource > scanForResourcesInPackage (String basePackageName ,
87
- Predicate <org .junit .platform .commons .support .Resource > resourceFilter ) {
88
- throw new UnsupportedOperationException ("Implement scanForResourcesInPackage(String, ResourceFilter) instead" );
89
- }
90
-
91
- /**
92
- * Find all {@linkplain org.junit.platform.commons.support.Resource resources} in the supplied classpath {@code root}
93
- * that match the specified {@code resourceFilter} predicate.
94
- *
95
- * <p>The classpath scanning algorithm searches recursively in subpackages
96
- * beginning with the root of the classpath.
97
- *
98
- * @param root the URI for the classpath root in which to scan; never
99
- * {@code null}
100
- * @param resourceFilter the resource type filter; never {@code null}
101
- * @return a list of all such resources found; never {@code null}
102
- * but potentially empty
103
- * @deprecated Please implement
104
- * {@link #scanForResourcesInClasspathRoot(URI, ResourceFilter)} instead
105
- */
106
- @ API (status = DEPRECATED , since = "6.0" )
107
- @ Deprecated (since = "6.0" , forRemoval = true )
108
- @ SuppressWarnings ("removal" )
109
- default List <org .junit .platform .commons .support .Resource > scanForResourcesInClasspathRoot (URI root ,
110
- Predicate <org .junit .platform .commons .support .Resource > resourceFilter ) {
111
- throw new UnsupportedOperationException (
112
- "Implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead" );
113
- }
114
-
115
65
/**
116
66
* Find all {@linkplain Resource resources} in the supplied classpath {@code root}
117
67
* that match the specified {@code resourceFilter} predicate.
@@ -128,12 +78,7 @@ default List<org.junit.platform.commons.support.Resource> scanForResourcesInClas
128
78
* @since 6.0
129
79
*/
130
80
@ API (status = MAINTAINED , since = "6.0" )
131
- @ SuppressWarnings ("removal" )
132
- default List <Resource > scanForResourcesInPackage (String basePackageName , ResourceFilter resourceFilter ) {
133
- return scanForResourcesInPackage (basePackageName , resource -> resourceFilter .match (oldToNew (resource ))).stream () //
134
- .map (ClasspathScanner ::oldToNew ) //
135
- .toList ();
136
- }
81
+ List <Resource > scanForResourcesInPackage (String basePackageName , ResourceFilter resourceFilter );
137
82
138
83
/**
139
84
* Find all {@linkplain Resource resources} in the supplied classpath {@code root}
@@ -150,16 +95,6 @@ default List<Resource> scanForResourcesInPackage(String basePackageName, Resourc
150
95
* @since 6.0
151
96
*/
152
97
@ API (status = MAINTAINED , since = "6.0" )
153
- @ SuppressWarnings ("removal" )
154
- default List <Resource > scanForResourcesInClasspathRoot (URI root , ResourceFilter resourceFilter ) {
155
- return scanForResourcesInClasspathRoot (root , r -> resourceFilter .match (oldToNew (r ))).stream () //
156
- .map (ClasspathScanner ::oldToNew ) //
157
- .toList ();
158
- }
159
-
160
- @ SuppressWarnings ("removal" )
161
- private static Resource oldToNew (org .junit .platform .commons .support .Resource oldResource ) {
162
- return Resource .of (oldResource .getName (), oldResource .getUri ());
163
- }
98
+ List <Resource > scanForResourcesInClasspathRoot (URI root , ResourceFilter resourceFilter );
164
99
165
100
}
0 commit comments