View Javadoc
1   /*
2    * Copyright (C) 2015, Google Inc. and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  
11  package org.eclipse.jgit.errors;
12  
13  /**
14   * Thrown by DirCache code when entries overlap in impossible way.
15   *
16   * @since 4.2
17   */
18  public class DirCacheNameConflictException extends IllegalStateException {
19  	private static final long serialVersionUID = 1L;
20  
21  	private final String path1;
22  	private final String path2;
23  
24  	/**
25  	 * Construct an exception for a specific path.
26  	 *
27  	 * @param path1
28  	 *            one path that conflicts.
29  	 * @param path2
30  	 *            another path that conflicts.
31  	 */
32  	public DirCacheNameConflictException(String path1, String path2) {
33  		super(path1 + ' ' + path2);
34  		this.path1 = path1;
35  		this.path2 = path2;
36  	}
37  
38  	/**
39  	 * Get one of the paths that has a conflict
40  	 *
41  	 * @return one of the paths that has a conflict
42  	 */
43  	public String getPath1() {
44  		return path1;
45  	}
46  
47  	/**
48  	 * Get another path that has a conflict
49  	 *
50  	 * @return another path that has a conflict
51  	 */
52  	public String getPath2() {
53  		return path2;
54  	}
55  }