Package io.quarkus.bootstrap.util
Class BootstrapUtils
java.lang.Object
io.quarkus.bootstrap.util.BootstrapUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ApplicationModeldeserializeQuarkusModel(Path modelPath) static voidexportModel(ApplicationModel model, boolean test) static PathgetSerializedTestAppModelPath(Path projectBuildDir) Returns a location where a serializedApplicationModelwould be found for test mode.static ArtifactKey[]static ApplicationModelreadAppModelWithWorkspaceId(Path file, int workspaceId) Deserializes anApplicationModelfrom a file.static PathresolveSerializedAppModelPath(Path projectBuildDir) Returns a location where a serializedApplicationModelwould be found for dev mode.static PathserializeAppModel(ApplicationModel model, boolean test) static voidserializeAppModel(ApplicationModel model, Path serializedModel) static Pathstatic String[]static StringtoTextFlags(int flags) Generates a comma-separated list of flag names for an integer representation of the flags.static voidwriteAppModelWithWorkspaceId(ApplicationModel appModel, int workspaceId, Path file) Serializes anApplicationModelalong with the workspace ID for which it was resolved.
-
Constructor Details
-
BootstrapUtils
public BootstrapUtils()
-
-
Method Details
-
splitByWhitespace
-
parseDependencyCondition
-
exportModel
public static void exportModel(ApplicationModel model, boolean test) throws AppModelResolverException, IOException - Throws:
AppModelResolverExceptionIOException
-
serializeAppModel
public static Path serializeAppModel(ApplicationModel model, boolean test) throws AppModelResolverException, IOException - Throws:
AppModelResolverExceptionIOException
-
serializeAppModel
public static void serializeAppModel(ApplicationModel model, Path serializedModel) throws IOException - Throws:
IOException
-
serializeQuarkusModel
- Throws:
IOException
-
deserializeQuarkusModel
public static ApplicationModel deserializeQuarkusModel(Path modelPath) throws AppModelResolverException - Throws:
AppModelResolverException
-
resolveSerializedAppModelPath
Returns a location where a serializedApplicationModelwould be found for dev mode.- Parameters:
projectBuildDir- project build directory- Returns:
- file of a serialized application model for dev mode
-
getSerializedTestAppModelPath
Returns a location where a serializedApplicationModelwould be found for test mode.- Parameters:
projectBuildDir- project build directory- Returns:
- file of a serialized application model for test mode
-
writeAppModelWithWorkspaceId
public static void writeAppModelWithWorkspaceId(ApplicationModel appModel, int workspaceId, Path file) throws IOException Serializes anApplicationModelalong with the workspace ID for which it was resolved. The serialization format will be different from the one used byresolveSerializedAppModelPath(Path)andgetSerializedTestAppModelPath(Path).- Parameters:
appModel- application model to serializeworkspaceId- workspace IDfile- target file- Throws:
IOException- in case of an IO failure
-
readAppModelWithWorkspaceId
public static ApplicationModel readAppModelWithWorkspaceId(Path file, int workspaceId) throws ClassNotFoundException, IOException Deserializes anApplicationModelfrom a file.The implementation will check whether the serialization format of the file matches the expected one. If it does not, the method will return null even if the file exists.
The implementation will compare the deserialized workspace ID to the argument
workspaceIdand if they don't match the method will return null.Once the
ApplicationModelwas deserialized, the dependency paths will be checked for existence. If a dependency path does not exist, the method will throw an exception.- Parameters:
file- serialized application model fileworkspaceId- expected workspace ID- Returns:
- deserialized application model
- Throws:
ClassNotFoundException- in case a required class could not be loadedIOException- in case of an IO failure
-
toTextFlags
Generates a comma-separated list of flag names for an integer representation of the flags.- Parameters:
flags- flags as an integer value- Returns:
- comma-separated list of the flag names
-