@Test void parseNativeWhenArchIsNotCorrect() { String packageName = "egl-wayland-1.1.3-1.fc30.x81111.rpm"; assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> RpmArtifactCoordinatesUtils.parse(packageName)) .withMessageContaining("Incorrect filename: package should have architecture or SRC suffix"); }
public static RpmArtifactCoordinates parse(@NotEmpty String path) { String fileName = FilenameUtils.getName(path); if (!fileName.endsWith(".rpm")) { throw new IllegalArgumentException("The artifact packaging can be only '.rpm'"); } String baseName = parseBaseName(fileName); String version = parseVersion(fileName); String release = parseRelease(fileName); RpmPackageType packageType = parsePackageType(fileName); RpmArtifactCoordinates artifactCoordinates; if (packageType == RpmPackageType.SOURCE) { artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType); } else { RpmPackageArch arch = parseArch(fileName); artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType, arch); } return artifactCoordinates; }
RpmArtifactCoordinatesUtils { public static RpmArtifactCoordinates parse(@NotEmpty String path) { String fileName = FilenameUtils.getName(path); if (!fileName.endsWith(".rpm")) { throw new IllegalArgumentException("The artifact packaging can be only '.rpm'"); } String baseName = parseBaseName(fileName); String version = parseVersion(fileName); String release = parseRelease(fileName); RpmPackageType packageType = parsePackageType(fileName); RpmArtifactCoordinates artifactCoordinates; if (packageType == RpmPackageType.SOURCE) { artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType); } else { RpmPackageArch arch = parseArch(fileName); artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType, arch); } return artifactCoordinates; } }
RpmArtifactCoordinatesUtils { public static RpmArtifactCoordinates parse(@NotEmpty String path) { String fileName = FilenameUtils.getName(path); if (!fileName.endsWith(".rpm")) { throw new IllegalArgumentException("The artifact packaging can be only '.rpm'"); } String baseName = parseBaseName(fileName); String version = parseVersion(fileName); String release = parseRelease(fileName); RpmPackageType packageType = parsePackageType(fileName); RpmArtifactCoordinates artifactCoordinates; if (packageType == RpmPackageType.SOURCE) { artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType); } else { RpmPackageArch arch = parseArch(fileName); artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType, arch); } return artifactCoordinates; }  }
RpmArtifactCoordinatesUtils { public static RpmArtifactCoordinates parse(@NotEmpty String path) { String fileName = FilenameUtils.getName(path); if (!fileName.endsWith(".rpm")) { throw new IllegalArgumentException("The artifact packaging can be only '.rpm'"); } String baseName = parseBaseName(fileName); String version = parseVersion(fileName); String release = parseRelease(fileName); RpmPackageType packageType = parsePackageType(fileName); RpmArtifactCoordinates artifactCoordinates; if (packageType == RpmPackageType.SOURCE) { artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType); } else { RpmPackageArch arch = parseArch(fileName); artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType, arch); } return artifactCoordinates; }  static RpmArtifactCoordinates parse(@NotEmpty String path); }
RpmArtifactCoordinatesUtils { public static RpmArtifactCoordinates parse(@NotEmpty String path) { String fileName = FilenameUtils.getName(path); if (!fileName.endsWith(".rpm")) { throw new IllegalArgumentException("The artifact packaging can be only '.rpm'"); } String baseName = parseBaseName(fileName); String version = parseVersion(fileName); String release = parseRelease(fileName); RpmPackageType packageType = parsePackageType(fileName); RpmArtifactCoordinates artifactCoordinates; if (packageType == RpmPackageType.SOURCE) { artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType); } else { RpmPackageArch arch = parseArch(fileName); artifactCoordinates = new RpmArtifactCoordinates(baseName, version, release, packageType, arch); } return artifactCoordinates; }  static RpmArtifactCoordinates parse(@NotEmpty String path);  }