Lines 861-877
Link Here
|
861 |
|
861 |
|
862 |
private static boolean isDir(BundleDescription bundle, IPublisherInfo info) { |
862 |
private static boolean isDir(BundleDescription bundle, IPublisherInfo info) { |
863 |
Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class); |
863 |
Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class); |
|
|
864 |
|
865 |
@SuppressWarnings("unchecked") |
866 |
Map<String, String> manifest = (Map<String, String>) bundle.getUserObject(); |
867 |
String format = manifest.get(BUNDLE_SHAPE); |
868 |
|
864 |
// if the advice has a shape, use it |
869 |
// if the advice has a shape, use it |
865 |
if (advice != null && !advice.isEmpty()) { |
870 |
if (advice != null && !advice.isEmpty()) { |
866 |
// we know there is some advice but if there is more than one, take the first. |
871 |
// we know there is some advice but if there is more than one, take the first. |
867 |
String shape = advice.iterator().next().getShape(); |
872 |
String shape = advice.iterator().next().getShape(); |
|
|
873 |
// If no format was set and advice was set to NONE then default behavior should be DIR |
874 |
if (IBundleShapeAdvice.NONE.equals(shape)) |
875 |
return !JAR.equals(format); |
868 |
if (shape != null) |
876 |
if (shape != null) |
869 |
return shape.equals(IBundleShapeAdvice.DIR); |
877 |
return shape.equals(IBundleShapeAdvice.DIR); |
870 |
} |
878 |
} |
|
|
879 |
|
871 |
// otherwise go with whatever we figured out from the manifest or the shape on disk |
880 |
// otherwise go with whatever we figured out from the manifest or the shape on disk |
872 |
@SuppressWarnings("unchecked") |
|
|
873 |
Map<String, String> manifest = (Map<String, String>) bundle.getUserObject(); |
874 |
String format = manifest.get(BUNDLE_SHAPE); |
875 |
return DIR.equals(format); |
881 |
return DIR.equals(format); |
876 |
} |
882 |
} |
877 |
|
883 |
|