/** * Obtains the {@link File} representing the archived artifact. */ protected File getFile(MavenBuild build) throws IOException { File f = new File(new File(new File(new File(build.getArtifactsDir(), groupId), artifactId), version), fileName); if(!f.exists()) throw new IOException("Archived artifact is missing: "+f); return f; }
/** * Obtains the {@link File} representing the archived artifact. * @throws FileNotFoundException if the archived artifact was missing * @deprecated only works with {@link StandardArtifactManager} and subclasses; use {@link #getTemporaryFile} instead */ @Deprecated public File getFile(MavenBuild build) throws IOException { @SuppressWarnings("deprecation") File artifactsDir = build.getArtifactsDir(); File f = new File(new File(new File(new File(artifactsDir, groupId), artifactId), version), canonicalName); if (!f.exists()) { throw new FileNotFoundException("Archived artifact is missing: " + f); } return f; }
/** * @deprecated Does not work with {@link ArtifactManager}. */ @Deprecated public FilePath getArtifactsDir() { return new FilePath(MavenBuild.this.getArtifactsDir()); }
public FilePath getArtifactsDir() { return new FilePath(MavenBuild.this.getArtifactsDir()); }
/** * Obtains the {@link java.io.File} representing the archived artifact. */ private File getArtifactFile(MavenBuild build, MavenArtifact mavenArtifact) throws IOException { String fileName = mavenArtifact.fileName; if (isArchiveJenkinsVersion) { fileName = mavenArtifact.canonicalName; } File file = new File(new File(new File(new File(build.getArtifactsDir(), mavenArtifact.groupId), mavenArtifact.artifactId), mavenArtifact.version), fileName); if (!file.exists()) { throw new FileNotFoundException("Archived artifact is missing: " + file + " " + getAdditionalMessage()); } return file; }