Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

patch for the other half of GH-84

  • Loading branch information...
commit 004f6f0e649aa0d56015a48a66298c0f2956184a 1 parent b735d7f
@buzztroll buzztroll authored
View
26 ...astic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/image/ServiceImageImpl.java
@@ -122,7 +122,7 @@ public DescribeImagesResponseType describeImages(DescribeImagesType req)
"Problem contacting repository: " + e.getMessage(), e);
}
- return this.convertFileListings(listings, ownerID, caller);
+ return this.convertFileListings(listings, ownerID, caller, req);
}
@@ -213,10 +213,28 @@ public DescribeImagesResponseType describeImages(DescribeImagesType req)
}
}
+ // this method is used to limit the list of images to the list the user requested. if the user
+ // made no specific requests then the full list is sent
+ private boolean inReq(String name, DescribeImagesType req) {
+ DescribeImagesItemType [] imgs = req.getImagesSet().getItem();
+
+ if (imgs == null || imgs.length == 0) {
+ return true;
+ }
+ for(int i = 0; i < imgs.length; i++) {
+ String req_name = imgs[0].getImageId();
+ if (name.equals(req_name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
protected DescribeImagesResponseType convertFileListings(
FileListing[] listings,
String ownerID,
- Caller caller) {
+ Caller caller,
+ DescribeImagesType req) {
final DescribeImagesResponseType dirt = new DescribeImagesResponseType();
final DescribeImagesResponseInfoType dirits =
@@ -243,6 +261,10 @@ protected DescribeImagesResponseType convertFileListings(
final String name = listing.getName();
+ if (!inReq(name, req)) {
+ continue;
+ }
+
try {
// all from same place currently
givenLocationBase = this.repository.getImageLocation(caller, name);
Please sign in to comment.
Something went wrong with that request. Please try again.