public String toString() { String format = getProperty(IArtifactDescriptor.FORMAT); if (format == null) return "canonical: " + key.toString(); //$NON-NLS-1$ return format + ": " + key.toString(); //$NON-NLS-1$ }
public String toString() { String format = getProperty(IArtifactDescriptor.FORMAT); if (format == null) return "canonical: " + key.toString(); //$NON-NLS-1$ return format + ": " + key.toString(); //$NON-NLS-1$ }
public int hashCode() { String format = getProperty(FORMAT); final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + Arrays.asList(processingSteps).hashCode(); result = prime * result + (format != null ? format.hashCode() : 0); return result; }
public int hashCode() { String format = getProperty(FORMAT); final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + Arrays.asList(processingSteps).hashCode(); result = prime * result + (format != null ? format.hashCode() : 0); return result; }
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; // Other implementations of IArtifactDescriptor must not be considered equal if (!(obj.getClass().equals(getClass()))) return false; ArtifactDescriptor other = (ArtifactDescriptor) obj; if (key == null) { if (other.getArtifactKey() != null) return false; } else if (!key.equals(other.getArtifactKey())) return false; if (!Arrays.equals(processingSteps, other.getProcessingSteps())) return false; String format = getProperty(FORMAT); String otherFormat = other.getProperty(FORMAT); if (format != null ? !format.equals(otherFormat) : otherFormat != null) return false; return true; }
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; // Other implementations of IArtifactDescriptor must not be considered equal if (!(obj.getClass().equals(getClass()))) return false; ArtifactDescriptor other = (ArtifactDescriptor) obj; if (key == null) { if (other.getArtifactKey() != null) return false; } else if (!key.equals(other.getArtifactKey())) return false; if (!Arrays.equals(processingSteps, other.getProcessingSteps())) return false; String format = getProperty(FORMAT); String otherFormat = other.getProperty(FORMAT); if (format != null ? !format.equals(otherFormat) : otherFormat != null) return false; return true; }
public synchronized URI createLocation(ArtifactDescriptor descriptor) { if (flatButPackedEnabled(descriptor)) { return getLocationForPackedButFlatArtifacts(descriptor); } // if the descriptor is canonical, clear out any UUID that might be set and use the Mapper if (descriptor.getProcessingSteps().length == 0) { descriptor.setProperty(ARTIFACT_UUID, null); IArtifactKey key = descriptor.getArtifactKey(); URI result = mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT)); if (result != null) { if (isFolderBased(descriptor) && URIUtil.lastSegment(result).endsWith(JAR_EXTENSION)) { return URIUtil.removeFileExtension(result); } return result; } } // Otherwise generate a location by creating a UUID, remembering it in the properties // and computing the location byte[] bytes = new UniversalUniqueIdentifier().toBytes(); descriptor.setProperty(ARTIFACT_UUID, bytesToHexString(bytes)); return blobStore.fileFor(bytes); }
public synchronized URI createLocation(ArtifactDescriptor descriptor) { if (flatButPackedEnabled(descriptor)) { return getLocationForPackedButFlatArtifacts(descriptor); } // if the descriptor is canonical, clear out any UUID that might be set and use the Mapper if (descriptor.getProcessingSteps().length == 0) { descriptor.setProperty(ARTIFACT_UUID, null); IArtifactKey key = descriptor.getArtifactKey(); URI result = mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT)); if (result != null) { if (isFolderBased(descriptor) && URIUtil.lastSegment(result).endsWith(JAR_EXTENSION)) { return URIUtil.removeFileExtension(result); } return result; } } // Otherwise generate a location by creating a UUID, remembering it in the properties // and computing the location byte[] bytes = new UniversalUniqueIdentifier().toBytes(); descriptor.setProperty(ARTIFACT_UUID, bytesToHexString(bytes)); return blobStore.fileFor(bytes); }
public synchronized URI createLocation(ArtifactDescriptor descriptor) { if (flatButPackedEnabled(descriptor)) { return getLocationForPackedButFlatArtifacts(descriptor); } // if the descriptor is canonical, clear out any UUID that might be set and use the Mapper if (descriptor.getProcessingSteps().length == 0) { descriptor.setProperty(ARTIFACT_UUID, null); IArtifactKey key = descriptor.getArtifactKey(); URI result = mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT)); if (result != null) { if (isFolderBased(descriptor) && URIUtil.lastSegment(result).endsWith(JAR_EXTENSION)) { return URIUtil.removeFileExtension(result); } return result; } } // Otherwise generate a location by creating a UUID, remembering it in the properties // and computing the location byte[] bytes = new UniversalUniqueIdentifier().toBytes(); descriptor.setProperty(ARTIFACT_UUID, bytesToHexString(bytes)); return blobStore.fileFor(bytes); }
public synchronized URI createLocation(ArtifactDescriptor descriptor) { if (flatButPackedEnabled(descriptor)) { return getLocationForPackedButFlatArtifacts(descriptor); } // if the descriptor is canonical, clear out any UUID that might be set and use the Mapper if (descriptor.getProcessingSteps().length == 0) { descriptor.setProperty(ARTIFACT_UUID, null); IArtifactKey key = descriptor.getArtifactKey(); URI result = mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT)); if (result != null) { if (isFolderBased(descriptor) && URIUtil.lastSegment(result).endsWith(JAR_EXTENSION)) { return URIUtil.removeFileExtension(result); } return result; } } // Otherwise generate a location by creating a UUID, remembering it in the properties // and computing the location byte[] bytes = new UniversalUniqueIdentifier().toBytes(); descriptor.setProperty(ARTIFACT_UUID, bytesToHexString(bytes)); return blobStore.fileFor(bytes); }