Utility class for handling package-related URIs in the context of LF (Lingua Franca) libraries.
More...
|
| static String | buildPackageURI (String uriStr, Resource resource) |
| | Build a package URI based on the provided URI string and resource.
|
| static Path | buildPackageURIfromSrc (String uriStr, String root) |
| | Builds a package URI based on the provided URI string and source path.
|
Utility class for handling package-related URIs in the context of LF (Lingua Franca) libraries.
This class provides methods to build URIs for accessing library files based on their location in a project structure, specifically targeting the "build/lfc_include" directory for library inclusion.
◆ buildPackageURI()
| String org.lflang.util.ImportUtil.buildPackageURI |
( |
String | uriStr, |
|
|
Resource | resource ) |
|
static |
Build a package URI based on the provided URI string and resource.
This traverses upwards from the current resource URI until it finds the "src" directory, then constructs the final URI pointing to the library file within the "build/lfc_include" directory.
- Parameters
-
| uriStr | A string representing the URI of the file. It must contain both the library name and file name, separated by a '/'. |
| resource | The resource from which the URI resolution should start. |
- Returns
- The constructed package URI as a string.
- Exceptions
-
| IllegalArgumentException | if the URI string does not contain both library and file names. |
◆ buildPackageURIfromSrc()
| Path org.lflang.util.ImportUtil.buildPackageURIfromSrc |
( |
String | uriStr, |
|
|
String | root ) |
|
static |
Builds a package URI based on the provided URI string and source path.
This method works similarly to the buildPackageURI, but it accepts a direct source path instead of a resource. It traverses upwards to locate the "src/" directory and then constructs the URI pointing to the library file.
- Parameters
-
| uriStr | A string representing the URI of the file. It must contain both the library name and file name, separated by a '/'. |
| root | The root path from which the URI resolution should start. |
- Returns
- The constructed package URI as a string.
- Exceptions
-
| IllegalArgumentException | if the URI string or source path is null, empty, or does not contain both the library name and file name. |
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/util/ImportUtil.java