Class ClassLoaderFiles
java.lang.Object
org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles
- All Implemented Interfaces:
Serializable
,ClassLoaderFileRepository
ClassLoaderFileRepository
that maintains a collection of
ClassLoaderFile
items grouped by source directories.- Since:
- 1.3.0
- Author:
- Phillip Webb
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An individual source directory that is being managed by the collection. -
Field Summary
Fields inherited from interface org.springframework.boot.devtools.restart.classloader.ClassLoaderFileRepository
NONE
-
Constructor Summary
ConstructorDescriptionCreate a newClassLoaderFiles
instance.ClassLoaderFiles
(ClassLoaderFiles classLoaderFiles) Create a newClassLoaderFiles
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(ClassLoaderFiles files) Add all elements items from the specifiedClassLoaderFiles
to this instance.void
addFile
(String sourceDirectory, String name, ClassLoaderFile file) Add a singleClassLoaderFile
to the collection.void
addFile
(String name, ClassLoaderFile file) Add a singleClassLoaderFile
to the collection.Return aClassLoaderFile
for the given name ornull
if no file is contained in this collection.protected final ClassLoaderFiles.SourceDirectory
Get or create aClassLoaderFiles.SourceDirectory
with the given name.Return allSourceDirectories
that have been added to the collection.int
size()
Return the size of the collection.
-
Constructor Details
-
ClassLoaderFiles
public ClassLoaderFiles()Create a newClassLoaderFiles
instance. -
ClassLoaderFiles
Create a newClassLoaderFiles
instance.- Parameters:
classLoaderFiles
- the source classloader files.
-
-
Method Details
-
addAll
Add all elements items from the specifiedClassLoaderFiles
to this instance.- Parameters:
files
- the files to add
-
addFile
Add a singleClassLoaderFile
to the collection.- Parameters:
name
- the name of the filefile
- the file to add
-
addFile
Add a singleClassLoaderFile
to the collection.- Parameters:
sourceDirectory
- the source directory of the filename
- the name of the filefile
- the file to add
-
getOrCreateSourceDirectory
Get or create aClassLoaderFiles.SourceDirectory
with the given name.- Parameters:
name
- the name of the directory- Returns:
- an existing or newly added
ClassLoaderFiles.SourceDirectory
-
getSourceDirectories
Return allSourceDirectories
that have been added to the collection.- Returns:
- a collection of
ClassLoaderFiles.SourceDirectory
items
-
size
public int size()Return the size of the collection.- Returns:
- the size of the collection
-
getFile
Description copied from interface:ClassLoaderFileRepository
Return aClassLoaderFile
for the given name ornull
if no file is contained in this collection.- Specified by:
getFile
in interfaceClassLoaderFileRepository
- Parameters:
name
- the name of the file- Returns:
- a
ClassLoaderFile
ornull
-