Package org.glassfish.jersey.server
Interface ResourceFinder
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.util.Iterator<java.lang.String>
- All Known Implementing Classes:
AbstractResourceFinderAdapter
,BundleSchemeResourceFinderFactory.BundleSchemeScanner
,CompositeResourceFinder
,FileSchemeResourceFinderFactory.FileSchemeScanner
,FilesScanner
,JarFileScanner
,JarZipSchemeResourceFinderFactory.JarZipSchemeScanner
,PackageNamesScanner
,VfsSchemeResourceFinderFactory.VfsResourceFinder
,WebAppResourcesScanner
public interface ResourceFinder extends java.util.Iterator<java.lang.String>, java.lang.AutoCloseable
An interface used for finding and opening (loading) new resources.ResourceConfig
will use all registered finders to obtain classes to be used as resource classes and/or providers. Methodopen()
doesn't need to be called on all returned resource names,ResourceConfig
can ignore some of them. Currently, all resource names ending with ".class" will be accepted and processed (opened). ExtendsAutoCloseable
since version 2.19. Theclose()
method is used to release allocated/opened resources (such as streams). When a resource finder is closed no other method should be invoked on it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
java.io.InputStream
open()
Open current resource.void
remove()
void
reset()
Reset theResourceFinder
instance.
-
-
-
Method Detail
-
open
java.io.InputStream open()
Open current resource.- Returns:
- input stream from which current resource can be loaded.
-
close
void close()
Release allocated/opened resources (such as streams). When the resource finder is closed no other method should be invoked on it.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Since:
- 2.19
-
reset
void reset()
Reset theResourceFinder
instance. Upon calling this method the implementing class MUST reset its internal state to the initial state.
-
remove
void remove()
This operation is not supported byResourceFinder
& throwsUnsupportedOperationException
when invoked.- Specified by:
remove
in interfacejava.util.Iterator<java.lang.String>
-
-