1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
.version
;
13 import org
.eclipse
.aether
.RepositoryException
;
16 * Thrown when a version or version range could not be parsed.
18 public class InvalidVersionSpecificationException
19 extends RepositoryException
22 private final String version
;
25 * Creates a new exception with the specified version and detail message.
27 * @param version The invalid version specification, may be {@code null}.
28 * @param message The detail message, may be {@code null}.
30 public InvalidVersionSpecificationException( String version
, String message
)
33 this.version
= version
;
37 * Creates a new exception with the specified version and cause.
39 * @param version The invalid version specification, may be {@code null}.
40 * @param cause The exception that caused this one, may be {@code null}.
42 public InvalidVersionSpecificationException( String version
, Throwable cause
)
44 super( "Could not parse version specification " + version
+ getMessage( ": ", cause
), cause
);
45 this.version
= version
;
49 * Creates a new exception with the specified version, detail message and cause.
51 * @param version The invalid version specification, may be {@code null}.
52 * @param message The detail message, may be {@code null}.
53 * @param cause The exception that caused this one, may be {@code null}.
55 public InvalidVersionSpecificationException( String version
, String message
, Throwable cause
)
57 super( message
, cause
);
58 this.version
= version
;
62 * Gets the version or version range that could not be parsed.
64 * @return The invalid version specification or {@code null} if unknown.
66 public String
getVersion()