private static bool IsArtifactUnderArchive(Artifact artifact) { var parts = GetUrlParts(artifact.Href, TeamCityRestUrlMetadataPart); // if any part ends with '!' and is supported by TeamCity then return true, otherwise false. return parts.Any(part => part[part.Length - 1].Equals(TeamCityArchiveIdentifier) && IsArchiveSupported(part.TrimEnd(TeamCityArchiveIdentifier))); }
private static bool IsFolder(Artifact artifact) { // folders have no size and have no content return (artifact.Size == 0) && (artifact.Content == null); }
private static bool IsArchive(Artifact artifact) { // archives have a non-zero size, have a content href, and they must be supported by TeamCity. return (artifact.Size > 0) && (artifact.Content != null) && IsArchiveSupported(artifact.Name); }