Class JBossVfsUtil

java.lang.Object
com.vaadin.flow.internal.JBossVfsUtil

public final class JBossVfsUtil extends Object
Reads what WildFly and JBoss serve from their virtual file system, through the 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The protocol WildFly and JBoss serve a deployed archive through.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<File>
    Gets the entries directly inside the given folder, files and folders alike, creating them on disk.
    static File
    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 File
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROTOCOL

      public static final String PROTOCOL
      The protocol WildFly and JBoss serve a deployed archive through.
      See Also:
  • Method Details

    • materializeFiles

      public static List<File> materializeFiles(URL folder) throws IOException
      Gets the entries directly inside the given folder, files and folders alike, creating them on disk.

      What is inside the folders of the folder is not included.

      Parameters:
      folder - the vfs URL of the folder
      Returns:
      the entries of the folder, in the places they were created
      Throws:
      IOException - if the folder cannot be read
    • materializeFolder

      public static File materializeFolder(URL folder) throws IOException
      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 - the vfs URL of the folder
      Returns:
      the folder on disk
      Throws:
      IOException - if the folder cannot be read
    • materializeJar

      public static File materializeJar(URL jar) throws IOException
      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 - the vfs URL of the jar
      Returns:
      the jar file on disk
      Throws:
      IOException - if the jar cannot be read or written