diff --git a/build.gradle b/build.gradle index 9a2aa76..1a28b77 100644 --- a/build.gradle +++ b/build.gradle @@ -285,6 +285,11 @@ if(hasProperty("java6Home")) { jars.add(it.path) } } + new File(java_bin_dir).eachFileRecurse { + if (it.path =~/\.jar$/) { + jars.add(it.path) + } + } } catch (FileNotFoundException e) { // do nothing. The check below will fail the build } diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java index 1477644..1c4fdb2 100644 --- a/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java +++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/AdminScriptResource.java @@ -22,25 +22,18 @@ *
* This interface allows read access to fields which are specific to admin scripts.
*/
-public interface AdminScriptResource extends RepositoryResource {
+public interface AdminScriptResource extends RepositoryResource, ApplicableToProduct {
/**
* Get the language that the script is written in
- *
+ *
* @return the language the script is written in, or null if it has not been set
*/
public String getScriptLanguage();
- /**
- * Gets the appliesTo field associated with the resource
- *
- * @return The appliesTo field associated with the resource, or null if it has not been set
- */
- public String getAppliesTo();
-
/**
* Gets the list of required features for this admin script
- *
+ *
* @return The list of required features for this admin script, or null if no features are required
*/
public Collection
* This interface allows read access to fields which are specific to config snippets.
*/
-public interface ConfigSnippetResource extends RepositoryResource {
+public interface ConfigSnippetResource extends RepositoryResource, ApplicableToProduct {
/**
* Gets the list of required features for this config snippet
- *
+ *
* @return The list of required features for this config snippet, or null if no features are required
*/
public Collection
* This interface allows read access to fields which are specific to features.
*/
-public interface EsaResource extends RepositoryResource {
+public interface EsaResource extends RepositoryResource, ApplicableToProduct {
/**
* Gets the symbolic name of the feature
@@ -62,13 +62,6 @@ public interface EsaResource extends RepositoryResource {
*/
public String getLowerCaseShortName();
- /**
- * Gets the appliesTo field associated with the resource
- *
- * @return The appliesTo field associated with the resource, or null if it has not been set
- */
- public String getAppliesTo();
-
/**
* Returns the value of the ibmProvisionCapability field (from the
* "IBM-Provision-Capability" header in the ESA's manifest) which gives
diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java
index 61eecd4..1a6b4e4 100644
--- a/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java
+++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/IfixResource.java
@@ -23,25 +23,18 @@
*
* This interface allows read access to fields which are specific to ifixes.
*/
-public interface IfixResource extends RepositoryResource {
+public interface IfixResource extends RepositoryResource, ApplicableToProduct {
/**
* Gets the list of APAR IDs which are provided in this ifix resource
- *
+ *
* @return the list of APAR IDs, or null if no APAR IDs are provided
*/
public Collection
* Products represented by this interface can either be of type {@link ResourceType#INSTALL} or {@link ResourceType#ADDON}.
*/
-public interface ProductResource extends ProductRelatedResource {
-
- /**
- * Gets the appliesTo field associated with the resource
- *
- * @return The appliesTo field associated with the resource, or null if it has not been set
- */
- public String getAppliesTo();
+public interface ProductResource extends ProductRelatedResource, ApplicableToProduct {
}
diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java
index ccdac8a..c46c57b 100644
--- a/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java
+++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/SampleResource.java
@@ -26,18 +26,11 @@
*
* Samples represented by this interface can either be of type {@link ResourceType#PRODUCTSAMPLE} or {@link ResourceType#OPENSOURCE}.
*/
-public interface SampleResource extends RepositoryResource {
-
- /**
- * Gets the appliesTo field associated with the resource
- *
- * @return The appliesTo field associated with the resource, or null if it has not been set
- */
- public String getAppliesTo();
+public interface SampleResource extends RepositoryResource, ApplicableToProduct {
/**
* Gets the list of required features for this sample
- *
+ *
* @return The list of required features for this sample, or null if it has not been set
*/
public Collection
* The short name should be the name of the server included in the sample.
- *
+ *
* @return The short name for this sample, or null if it has not been set
*/
public String getShortName();
diff --git a/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java b/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java
index 4f97fd5..124f156 100644
--- a/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java
+++ b/client-lib/src/main/java/com/ibm/ws/repository/resources/writeable/WritableResourceFactory.java
@@ -17,6 +17,7 @@
import com.ibm.ws.repository.common.enums.ResourceType;
import com.ibm.ws.repository.connections.RepositoryConnection;
+import com.ibm.ws.repository.exceptions.RepositoryResourceCreationException;
import com.ibm.ws.repository.resources.internal.AdminScriptResourceImpl;
import com.ibm.ws.repository.resources.internal.ConfigSnippetResourceImpl;
import com.ibm.ws.repository.resources.internal.EsaResourceImpl;
@@ -62,4 +63,27 @@ public static ToolResourceWritable createTool(RepositoryConnection repoConnectio
return new ToolResourceImpl(repoConnection);
}
+ public static RepositoryResourceWritable createResource(RepositoryConnection repoConnection, ResourceType type) throws RepositoryResourceCreationException {
+ switch (type) {
+ case ADDON:
+ case INSTALL:
+ return createProduct(repoConnection, type);
+ case ADMINSCRIPT:
+ return createAdminScript(repoConnection);
+ case CONFIGSNIPPET:
+ return createConfigSnippet(repoConnection);
+ case FEATURE:
+ return createEsa(repoConnection);
+ case IFIX:
+ return createIfix(repoConnection);
+ case OPENSOURCE:
+ case PRODUCTSAMPLE:
+ return createSample(repoConnection, type);
+ case TOOL:
+ return createTool(repoConnection);
+ default:
+ throw new RepositoryResourceCreationException("Can not create an asset of type " + type, null);
+ }
+ }
+
}