aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/errors/DirCacheNameConflictException.java
blob: d8beb8af42a95218155b832a879275c91fdff921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright (C) 2015, Google Inc. and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.errors;

/**
 * Thrown by DirCache code when entries overlap in impossible way.
 *
 * @since 4.2
 */
public class DirCacheNameConflictException extends IllegalStateException {
	private static final long serialVersionUID = 1L;

	private final String path1;
	private final String path2;

	/**
	 * Construct an exception for a specific path.
	 *
	 * @param path1
	 *            one path that conflicts.
	 * @param path2
	 *            another path that conflicts.
	 */
	public DirCacheNameConflictException(String path1, String path2) {
		super(path1 + ' ' + path2);
		this.path1 = path1;
		this.path2 = path2;
	}

	/**
	 * Get one of the paths that has a conflict
	 *
	 * @return one of the paths that has a conflict
	 */
	public String getPath1() {
		return path1;
	}

	/**
	 * Get another path that has a conflict
	 *
	 * @return another path that has a conflict
	 */
	public String getPath2() {
		return path2;
	}
}