EntryExistsException.java

  1. /*
  2.  * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
  3.  * Copyright (C) 2006-2007, Shawn O. Pearce <spearce@spearce.org> and others
  4.  *
  5.  * This program and the accompanying materials are made available under the
  6.  * terms of the Eclipse Distribution License v. 1.0 which is available at
  7.  * https://www.eclipse.org/org/documents/edl-v10.php.
  8.  *
  9.  * SPDX-License-Identifier: BSD-3-Clause
  10.  */

  11. package org.eclipse.jgit.errors;

  12. import java.io.IOException;
  13. import java.text.MessageFormat;

  14. import org.eclipse.jgit.internal.JGitText;

  15. /**
  16.  * Attempt to add an entry to a tree that already exists.
  17.  */
  18. public class EntryExistsException extends IOException {
  19.     private static final long serialVersionUID = 1L;

  20.     /**
  21.      * Construct an EntryExistsException when the specified name already
  22.      * exists in a tree.
  23.      *
  24.      * @param name workdir relative file name
  25.      */
  26.     public EntryExistsException(String name) {
  27.         super(MessageFormat.format(JGitText.get().treeEntryAlreadyExists, name));
  28.     }
  29. }