Class ClassLoaderFiles
- java.lang.Object
- org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles
- All Implemented Interfaces:
Serializable
,ClassLoaderFileRepository
public class ClassLoaderFiles extends Object implements ClassLoaderFileRepository, Serializable
ClassLoaderFileRepository
that maintains a collection ofClassLoaderFile
items grouped by source folders.- Since:
- 1.3.0
- See Also:
ClassLoaderFile
,ClassLoaderRepository
, Serialized Form
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassLoaderFiles.SourceFolder
An individual source folder that is being managed by the collection.
Field Summary
Fields inherited from interface org.springframework.boot.devtools.restart.classloader.ClassLoaderFileRepository
NONE
Constructor Summary
Constructors Constructor Description ClassLoaderFiles()
Create a newClassLoaderFiles
instance.ClassLoaderFiles(ClassLoaderFiles classLoaderFiles)
Create a newClassLoaderFiles
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(ClassLoaderFiles files)
Add all elements items from the specifiedClassLoaderFiles
to this instance.void
addFile(String sourceFolder, String name, ClassLoaderFile file)
Add a singleClassLoaderFile
to the collection.void
addFile(String name, ClassLoaderFile file)
Add a singleClassLoaderFile
to the collection.ClassLoaderFile
getFile(String name)
Return aClassLoaderFile
for the given name ornull
if no file is contained in this collection.protected ClassLoaderFiles.SourceFolder
getOrCreateSourceFolder(String name)
Get or create aClassLoaderFiles.SourceFolder
with the given name.Collection<ClassLoaderFiles.SourceFolder>
getSourceFolders()
Return allSourceFolders
that have been added to the collection.int
size()
Return the size of the collection.
Constructor Detail
ClassLoaderFiles
public ClassLoaderFiles()
Create a newClassLoaderFiles
instance.
ClassLoaderFiles
public ClassLoaderFiles(ClassLoaderFiles classLoaderFiles)
Create a newClassLoaderFiles
instance.- Parameters:
classLoaderFiles
- the source classloader files.
Method Detail
addAll
public void addAll(ClassLoaderFiles files)
Add all elements items from the specifiedClassLoaderFiles
to this instance.- Parameters:
files
- the files to add
addFile
public void addFile(String name, ClassLoaderFile file)
Add a singleClassLoaderFile
to the collection.- Parameters:
name
- the name of the filefile
- the file to add
addFile
public void addFile(String sourceFolder, String name, ClassLoaderFile file)
Add a singleClassLoaderFile
to the collection.- Parameters:
sourceFolder
- the source folder of the filename
- the name of the filefile
- the file to add
getOrCreateSourceFolder
protected final ClassLoaderFiles.SourceFolder getOrCreateSourceFolder(String name)
Get or create aClassLoaderFiles.SourceFolder
with the given name.- Parameters:
name
- the name of the folder- Returns:
- an existing or newly added
ClassLoaderFiles.SourceFolder
getSourceFolders
public Collection<ClassLoaderFiles.SourceFolder> getSourceFolders()
Return allSourceFolders
that have been added to the collection.- Returns:
- a collection of
ClassLoaderFiles.SourceFolder
items
size
public int size()
Return the size of the collection.- Returns:
- the size of the collection
getFile
public ClassLoaderFile getFile(String name)
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