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
ClassLoaderFileRepositorythat maintains a collection ofClassLoaderFileitems 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 classClassLoaderFiles.SourceFolderAn 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 newClassLoaderFilesinstance.ClassLoaderFiles(ClassLoaderFiles classLoaderFiles)Create a newClassLoaderFilesinstance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(ClassLoaderFiles files)Add all elements items from the specifiedClassLoaderFilesto this instance.voidaddFile(String sourceFolder, String name, ClassLoaderFile file)Add a singleClassLoaderFileto the collection.voidaddFile(String name, ClassLoaderFile file)Add a singleClassLoaderFileto the collection.ClassLoaderFilegetFile(String name)Return aClassLoaderFilefor the given name ornullif no file is contained in this collection.protected ClassLoaderFiles.SourceFoldergetOrCreateSourceFolder(String name)Get or create aClassLoaderFiles.SourceFolderwith the given name.Collection<ClassLoaderFiles.SourceFolder>getSourceFolders()Return allSourceFoldersthat have been added to the collection.intsize()Return the size of the collection.
Constructor Detail
ClassLoaderFiles
public ClassLoaderFiles()
Create a newClassLoaderFilesinstance.
ClassLoaderFiles
public ClassLoaderFiles(ClassLoaderFiles classLoaderFiles)
Create a newClassLoaderFilesinstance.- Parameters:
classLoaderFiles- the source classloader files.
Method Detail
addAll
public void addAll(ClassLoaderFiles files)
Add all elements items from the specifiedClassLoaderFilesto this instance.- Parameters:
files- the files to add
addFile
public void addFile(String name, ClassLoaderFile file)
Add a singleClassLoaderFileto 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 singleClassLoaderFileto 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.SourceFolderwith 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 allSourceFoldersthat have been added to the collection.- Returns:
- a collection of
ClassLoaderFiles.SourceFolderitems
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:ClassLoaderFileRepositoryReturn aClassLoaderFilefor the given name ornullif no file is contained in this collection.- Specified by:
getFilein interfaceClassLoaderFileRepository- Parameters:
name- the name of the file- Returns:
- a
ClassLoaderFileornull