From 91c285626797bee553d372eef9a415c7d4951d53 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Gonzalez Date: Mon, 10 Jan 2005 21:45:00 +0000 Subject: [PATCH] Added javadoc and war handlers git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163304 13f79535-47bb-0310-9956-ffa450edef68 --- .../artifact/handler/JavadocHandler.java | 44 +++++++++++++++++++ .../maven/artifact/handler/WarHandler.java | 35 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 maven-artifact/src/main/java/org/apache/maven/artifact/handler/JavadocHandler.java create mode 100644 maven-artifact/src/main/java/org/apache/maven/artifact/handler/WarHandler.java diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/handler/JavadocHandler.java b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/JavadocHandler.java new file mode 100644 index 0000000000..0e349e231b --- /dev/null +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/JavadocHandler.java @@ -0,0 +1,44 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.maven.artifact.handler; + +import org.apache.maven.artifact.Artifact; + +import java.io.File; + +/** + * @author Carlos Sanchez + * @version $Id$ + */ +public class JavadocHandler + extends AbstractArtifactHandler +{ + public File source( String basedir, Artifact artifact ) + { + return new File( basedir, artifact.getArtifactId() + "-" + artifact.getVersion() + "-javadocs." + extension() ); + } + + public String extension() + { + return "jar"; + } + + public String directory() + { + return "javadocs"; + } +} \ No newline at end of file diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/handler/WarHandler.java b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/WarHandler.java new file mode 100644 index 0000000000..68cbe9a9e4 --- /dev/null +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/WarHandler.java @@ -0,0 +1,35 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.maven.artifact.handler; + +/** + * @author Carlos Sanchez + * @version $Id$ + */ +public class WarHandler + extends AbstractArtifactHandler +{ + public String extension() + { + return "war"; + } + + public String directory() + { + return "wars"; + } +}