Class ProdBundleUtils

java.lang.Object
com.vaadin.flow.server.frontend.ProdBundleUtils

public class ProdBundleUtils extends Object
Helpers related to the production bundle.

For internal use only. May be renamed or removed in a future release.

Since:
24.3
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    compressBundle(File projectDir, File prodBundleFolder)
    Compress the prod bundle at give location into src/main/bundles.
    static String
    findBundleStatsJson(File projectDir, ClassFinder finder)
    Get the stats.json for the application specific production bundle or from the default bundle if it exists.
    static File
    getProdBundle(File projectDir)
    Get the application specific production bundle file.
    static boolean
    hasBundleFile(File projectDir, ClassFinder finder, String filename)
    Checks if the given file is part of the production bundle in use, which is the application specific bundle when the application has one and the default bundle from the class path otherwise.
    static void
    unpackBundle(File projectDir, File prodBundleFolder)
    Unpack the compressed prod bundle from src/main/bundles if it exists into the given location.

    Methods inherited from class java.lang.Object

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

    • getProdBundle

      public static File getProdBundle(File projectDir)
      Get the application specific production bundle file.
      Parameters:
      projectDir - the project base directory
      Returns:
      the bundle directory
    • findBundleStatsJson

      public static String findBundleStatsJson(File projectDir, ClassFinder finder) throws IOException
      Get the stats.json for the application specific production bundle or from the default bundle if it exists.
      Parameters:
      projectDir - the project base directory
      finder - class finder
      Returns:
      stats.json content or null if not found
      Throws:
      IOException - if an I/O exception occurs.
    • hasBundleFile

      public static boolean hasBundleFile(File projectDir, ClassFinder finder, String filename) throws IOException
      Checks if the given file is part of the production bundle in use, which is the application specific bundle when the application has one and the default bundle from the class path otherwise.
      Parameters:
      projectDir - the project base directory
      finder - class finder
      filename - the file path within the bundle
      Returns:
      true if the file is part of the bundle
      Throws:
      IOException - if an I/O exception occurs.
    • compressBundle

      public static void compressBundle(File projectDir, File prodBundleFolder)
      Compress the prod bundle at give location into src/main/bundles.
      Parameters:
      projectDir - current project root directory
      prodBundleFolder - prod bundle location
    • unpackBundle

      public static void unpackBundle(File projectDir, File prodBundleFolder)
      Unpack the compressed prod bundle from src/main/bundles if it exists into the given location.
      Parameters:
      projectDir - current project root directory
      prodBundleFolder - unpacked prod bundle location