Package org.webjars
Class WebJarExtractor
java.lang.Object
org.webjars.WebJarExtractor
Utility for extracting WebJars onto the filesystem. The extractor also recognises the node_modules
convention used by WebJars. node_modules are a special place within a WebJar that contain the assets
required in an environment conforming to the Node API for require.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Extract the bower_components of all WebJars and merge them into the same folder.void
Extract the node_modules of all WebJars and merge them into the same folder.void
Extract all WebJars.void
extractWebJarTo
(String name, File to) Extract the given WebJar to the given location.protected static String
getJsonModuleId
(String packageJson)
-
Field Details
-
PACKAGE_JSON
The node_modules directory prefix as a convenience.- See Also:
-
BOWER_JSON
The bower.json file name.- See Also:
-
-
Constructor Details
-
WebJarExtractor
public WebJarExtractor() -
WebJarExtractor
-
-
Method Details
-
extractAllWebJarsTo
Extract all WebJars.- Parameters:
to
- The directory to extract to- Throws:
IOException
- There was a problem extracting the WebJars
-
extractWebJarTo
Extract the given WebJar to the given location. The WebJar will be extracted, without its version in the path, to the given directory.- Parameters:
name
- The name of the WebJar to extract.to
- The location to extract it to. All WebJars will be merged into this location.- Throws:
IOException
- There was a problem extracting the WebJars
-
extractAllNodeModulesTo
Extract the node_modules of all WebJars and merge them into the same folder.- Parameters:
to
- The location to extract it to. All WebJars will be merged into this location.- Throws:
IOException
- There was a problem extracting the WebJars
-
extractAllBowerComponentsTo
Extract the bower_components of all WebJars and merge them into the same folder.- Parameters:
to
- The location to extract it to. All WebJars will be merged into this location.- Throws:
IOException
- There was a problem extracting the WebJars
-
getJsonModuleId
- Throws:
IOException
-