* @throws MojoExecutionException
*/
protected void configure(String targetURL, File file)
throws MojoExecutionException {
// first, let's get the manifest and see if initial content is configured
ManifestHeader header = null;
try {
final Manifest mf = this.getManifest(file);
final String value = mf.getMainAttributes().getValue(HEADER_INITIAL_CONTENT);
if ( value == null ) {
getLog().debug("Bundle has no initial content - no file system provider config created.");
return;
}
header = ManifestHeader.parse(value);
if ( header == null || header.getEntries().length == 0 ) {
getLog().warn("Unable to parse header or header is empty: " + value);
return;
}
} catch (IOException ioe) {
throw new MojoExecutionException("Unable to read manifest from file " + file, ioe);
}
// setup http client
final HttpClient client = getHttpClient();
getLog().info("Trying to configure file system provider...");
// quick check if resources are configured
final List resources = project.getResources();
if ( resources == null || resources.size() == 0 ) {
throw new MojoExecutionException("No resources configured for this project.");
}
// now get current configurations
final Map oldConfigs = this.getCurrentFileProviderConfigs(targetURL, client);
final Entry[] entries = header.getEntries();
for(final Entry entry : entries) {
final String path = entry.getValue();
// check if we should ignore this
final String ignoreValue = entry.getDirectiveValue("maven:mount");
if ( ignoreValue != null && ignoreValue.equalsIgnoreCase("false") ) {