All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.gradle.BundleService.groovy Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 1.7.6
Show newest version
package com.github.dynamicextensionsalfresco.gradle

/**
 * Client for performing operations against the REST API
 */
class BundleService {

	RestClient client = new RestClient()
	
	String apiPath = "/dynamic-extensions/api"

	def installBundle(File file) {
		if (!file.exists()) {
			throw new FileNotFoundException(file.path)
		}
		if (!file.name.matches(/.+\.jar$/)) {
			throw new IllegalArgumentException("Not a JAR file: ${file.absolutePath}.");
		}
		client.postFile(path: "$apiPath/bundles", file: file, mimeType: "application/java-archive")
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy