Class CSSFileHelper
java.lang.Object
org.ametys.plugins.core.ui.resources.css.CSSFileHelper
Helper for CSS Files
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Pattern
Regex that matches an @import statement in a css file, with optional media -
Method Summary
Modifier and TypeMethodDescriptionstatic String
replaceRelativeResourcesUri
(String content, String fileUri, JSASSResourceURIExtensionPoint jsassResourceURIExtensionPoint, String externalContextPath) Replace the relative URI inside a css file with the new context pathstatic String
replaceRelativeUri
(String content, String fileUri, JSASSResourceURIExtensionPoint jsassResourceURIExtensionPoint, String internalContextPath, String externalContextPath) Replace the relative URI inside a css file with the new context path
-
Field Details
-
IMPORT_PATTERN
Regex that matches an @import statement in a css file, with optional media
-
-
Method Details
-
replaceRelativeUri
public static String replaceRelativeUri(String content, String fileUri, JSASSResourceURIExtensionPoint jsassResourceURIExtensionPoint, String internalContextPath, String externalContextPath) throws URISyntaxException Replace the relative URI inside a css file with the new context path- Parameters:
content
- The file contentfileUri
- The file UrijsassResourceURIExtensionPoint
- The JSASS Resource URI extension pointinternalContextPath
- The internal context path of the applicationexternalContextPath
- The external context path of the application- Returns:
- The file content, with URIs replaced
- Throws:
URISyntaxException
- If an exception occurred
-
replaceRelativeResourcesUri
public static String replaceRelativeResourcesUri(String content, String fileUri, JSASSResourceURIExtensionPoint jsassResourceURIExtensionPoint, String externalContextPath) throws URISyntaxException Replace the relative URI inside a css file with the new context path- Parameters:
content
- The file contentfileUri
- The file Uri, without context path, for example "/plugins/pluginName/resources/style.css" or "/skins/skinName/resources/style.scss"jsassResourceURIExtensionPoint
- The JSASS Resource URI extension pointexternalContextPath
- The external context path of the application- Returns:
- The file content, with URIs replaced
- Throws:
URISyntaxException
- If an exception occurred
-