Class JBossVfsUtil
vfs protocol.
The virtual file system is reached with reflection, as a dependency to WildFly or JBoss cannot be afforded, and a virtual file only exists on disk once its physical file has been asked for.
For internal use only. May be renamed or removed in a future release.
- Since:
- 25.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA file of the virtual file system, read without creating it on disk. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic List<JBossVfsUtil.VfsFile> Gets the files directly inside the given folder, to be read as they are without creating anything on disk.static FilematerializeFolder(URL folder) Gets the given folder as a folder on disk, creating it and everything inside it, so that the caller can read the folder as a whole.static FilematerializeJar(URL jar) Packs the given jar into a jar file on disk, as a jar of the virtual file system is not a file the caller can open on its own.
-
Field Details
-
PROTOCOL
The protocol WildFly and JBoss serve a deployed archive through.- See Also:
-
-
Method Details
-
listFiles
Gets the files directly inside the given folder, to be read as they are without creating anything on disk.The folders of the folder and what is inside them are not included.
- Parameters:
folder- thevfsURL of the folder- Returns:
- the files of the folder
- Throws:
IOException- if the folder cannot be read
-
materializeFolder
Gets the given folder as a folder on disk, creating it and everything inside it, so that the caller can read the folder as a whole.The caller only gets what the virtual file system created inside the folder. A mount that creates something of its own elsewhere, such as a jar inside the folder, is not part of the folder that is returned, which is not expected to happen and is warned about.
- Parameters:
folder- thevfsURL of the folder- Returns:
- the folder on disk
- Throws:
IOException- if the folder cannot be read
-
materializeJar
Packs the given jar into a jar file on disk, as a jar of the virtual file system is not a file the caller can open on its own.The jar is written into a temporary folder of its own, rather than into the temporary folder shared by everything on the machine, and both are deleted when the JVM exits.
- Parameters:
jar- thevfsURL of the jar- Returns:
- the jar file on disk
- Throws:
IOException- if the jar cannot be read or written
-