/** * return what the suggested archiveName is * * @param ref * @return */ public String getDefaultArchiveName(IVirtualReference ref) { if (!ref.getReferencedComponent().isBinary()) { return getDefaultProjectArchiveName(ref.getReferencedComponent()); } // binary return new Path(ref.getReferencedComponent().getDeployedName()).lastSegment(); }
protected boolean hasChanged(IVirtualReference[] existingRefs, IVirtualReference[] refArray) { if (existingRefs == refArray) { return false; } if (existingRefs == null || existingRefs.length != refArray.length) { return true; } for (int i = 0; i < existingRefs.length; i++) { IVirtualReference existingRef = existingRefs[i]; IVirtualReference newRef = refArray[i]; if ((existingRef.getArchiveName() != null && !existingRef.getArchiveName().equals(newRef.getArchiveName())) || !existingRef.getReferencedComponent().equals(newRef.getReferencedComponent()) || !existingRef.getRuntimePath().equals(newRef.getRuntimePath())) { return true; } } return false; }
protected String toString(IVirtualReference[] references) { StringBuilder sb = new StringBuilder("["); String sep = ""; for (IVirtualReference reference : references) { IVirtualComponent component = reference.getReferencedComponent(); sb.append(sep).append(reference.getRuntimePath() + " - "); sb.append(component.getName()); sb.append(" " + component.getMetaProperties()); sep = ", "; } return sb.append(']').toString(); }