@@ -140,7 +140,7 @@ public static Provider fromPath(final Path path, final BiPredicate<String, Strin
140140 try {
141141 var entries = Files .readAllLines (path ).stream ()
142142 .map (String ::trim )
143- .filter (l -> ! l . isEmpty () && !l .startsWith ("#" )) // We support comments :)
143+ .filter (l ->l . length () > 0 && !l .startsWith ("#" )) // We support comments :)
144144 .filter (p -> pkgFilter == null || pkgFilter .test (p .replace ('.' ,'/' ), "" ))
145145 .toList ();
146146 return new Provider (sname , entries );
@@ -153,4 +153,62 @@ public static Provider fromPath(final Path path, final BiPredicate<String, Strin
153153 enum Status {
154154 NONE , INVALID , UNVERIFIED , VERIFIED
155155 }
156+
157+ /**
158+ * @deprecated Obtain via the {@link ModuleDescriptor} of the jar if you really need this.
159+ */
160+ @ Deprecated (forRemoval = true , since = "2.1.16" )
161+ default Set <String > getPackages () {
162+ return moduleDataProvider ().descriptor ().packages ();
163+ }
164+
165+ /**
166+ * @deprecated Obtain via the {@link ModuleDescriptor} of the jar if you really need this.
167+ */
168+ @ Deprecated (forRemoval = true , since = "2.1.16" )
169+ default List <Provider > getProviders () {
170+ return moduleDataProvider ().descriptor ().provides ().stream ()
171+ .map (p -> new Provider (p .service (), p .providers ()))
172+ .toList ();
173+ }
174+
175+ /**
176+ * @deprecated Use {@link JarContentsBuilder} and {@link #from(JarContents)} instead.
177+ */
178+ @ Deprecated (forRemoval = true , since = "2.1.16" )
179+ static SecureJar from (BiPredicate <String , String > filter , final Path ... paths ) {
180+ return from (jar ->JarMetadata .from (jar , paths ), filter , paths );
181+ }
182+
183+ /**
184+ * @deprecated Use {@link JarContentsBuilder} and {@link #from(JarContents)} instead.
185+ */
186+ @ Deprecated (forRemoval = true , since = "2.1.16" )
187+ static SecureJar from (Function <SecureJar , JarMetadata > metadataSupplier , final Path ... paths ) {
188+ return from (Manifest ::new , metadataSupplier , paths );
189+ }
190+
191+ /**
192+ * @deprecated Use {@link JarContentsBuilder} and {@link #from(JarContents)} instead.
193+ */
194+ @ Deprecated (forRemoval = true , since = "2.1.16" )
195+ static SecureJar from (Function <SecureJar , JarMetadata > metadataSupplier , BiPredicate <String , String > filter , final Path ... paths ) {
196+ return from (Manifest ::new , metadataSupplier , filter , paths );
197+ }
198+
199+ /**
200+ * @deprecated Use {@link JarContentsBuilder} and {@link #from(JarContents)} instead.
201+ */
202+ @ Deprecated (forRemoval = true , since = "2.1.16" )
203+ static SecureJar from (Supplier <Manifest > defaultManifest , Function <SecureJar , JarMetadata > metadataSupplier , final Path ... paths ) {
204+ return from (defaultManifest , metadataSupplier , null , paths );
205+ }
206+
207+ /**
208+ * @deprecated Use {@link JarContentsBuilder} and {@link #from(JarContents)} instead.
209+ */
210+ @ Deprecated (forRemoval = true , since = "2.1.16" )
211+ static SecureJar from (Supplier <Manifest > defaultManifest , Function <SecureJar , JarMetadata > metadataSupplier , BiPredicate <String , String > filter , final Path ... paths ) {
212+ return new Jar (defaultManifest , metadataSupplier , filter , paths );
213+ }
156214}
0 commit comments