Package spoon.support.compiler
Class VirtualFolder
- java.lang.Object
-
- spoon.support.compiler.VirtualFolder
-
- All Implemented Interfaces:
SpoonFolder
,SpoonResource
- Direct Known Subclasses:
FilteringFolder
public class VirtualFolder extends Object implements SpoonFolder
-
-
Constructor Summary
Constructors Constructor Description VirtualFolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFile(SpoonFile o)
Adds a file in this foldervoid
addFolder(SpoonFolder o)
Adds a sub folder in this folderList<SpoonFile>
getAllFiles()
Gets all the files (including folders) in the folder.List<SpoonFile>
getAllJavaFiles()
Gets all the Java source files in the folder.List<SpoonFile>
getFiles()
Gets all the files (excluding folders) in the folder.File
getFileSystemParent()
Gets the parent of this resource on the file system.String
getName()
Gets the name of this resource.SpoonFolder
getParent()
Gets the folder that contains this resource.String
getPath()
Gets this resource path.List<SpoonFolder>
getSubFolders()
Gets the subfolders in this folder.boolean
isArchive()
Tells if this resource is an archive.boolean
isFile()
Tells if this resource is a file.File
toFile()
Gets the corresponding file if possible (returns null if this resource does not correspond to any file on the filesystem).String
toString()
-
-
-
Method Detail
-
addFile
public void addFile(SpoonFile o)
Description copied from interface:SpoonFolder
Adds a file in this folder- Specified by:
addFile
in interfaceSpoonFolder
-
addFolder
public void addFolder(SpoonFolder o)
Description copied from interface:SpoonFolder
Adds a sub folder in this folder- Specified by:
addFolder
in interfaceSpoonFolder
-
getAllFiles
public List<SpoonFile> getAllFiles()
Description copied from interface:SpoonFolder
Gets all the files (including folders) in the folder.- Specified by:
getAllFiles
in interfaceSpoonFolder
-
getAllJavaFiles
public List<SpoonFile> getAllJavaFiles()
Description copied from interface:SpoonFolder
Gets all the Java source files in the folder.- Specified by:
getAllJavaFiles
in interfaceSpoonFolder
-
getFiles
public List<SpoonFile> getFiles()
Description copied from interface:SpoonFolder
Gets all the files (excluding folders) in the folder.- Specified by:
getFiles
in interfaceSpoonFolder
-
getName
public String getName()
Description copied from interface:SpoonResource
Gets the name of this resource.- Specified by:
getName
in interfaceSpoonResource
-
getParent
public SpoonFolder getParent()
Description copied from interface:SpoonResource
Gets the folder that contains this resource.- Specified by:
getParent
in interfaceSpoonResource
-
getSubFolders
public List<SpoonFolder> getSubFolders()
Description copied from interface:SpoonFolder
Gets the subfolders in this folder.- Specified by:
getSubFolders
in interfaceSpoonFolder
-
isFile
public boolean isFile()
Description copied from interface:SpoonResource
Tells if this resource is a file.- Specified by:
isFile
in interfaceSpoonResource
-
getPath
public String getPath()
Description copied from interface:SpoonResource
Gets this resource path.- Specified by:
getPath
in interfaceSpoonResource
-
getFileSystemParent
public File getFileSystemParent()
Description copied from interface:SpoonResource
Gets the parent of this resource on the file system.- Specified by:
getFileSystemParent
in interfaceSpoonResource
-
isArchive
public boolean isArchive()
Description copied from interface:SpoonResource
Tells if this resource is an archive.- Specified by:
isArchive
in interfaceSpoonResource
-
toFile
public File toFile()
Description copied from interface:SpoonResource
Gets the corresponding file if possible (returns null if this resource does not correspond to any file on the filesystem).- Specified by:
toFile
in interfaceSpoonResource
-
-