]> source.dussan.org Git - jgit.git/commitdiff
Add String form of PackInvalidException constructor 28/3928/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 29 Jun 2011 16:51:54 +0000 (09:51 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 28 Jul 2011 17:07:09 +0000 (10:07 -0700)
This way the path can be supplied as a string, without first
converting to a java.io.File.

Change-Id: I54d9bb9867556cd98b378c0762054b31497459cb

org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java

index 59354ddb70427378287c3b866c3c65d0f1d103a6..3db720a9275db643a3251ae07460f0d39d52d923 100644 (file)
@@ -60,6 +60,16 @@ public class PackInvalidException extends IOException {
         *            path of the invalid pack file.
         */
        public PackInvalidException(final File path) {
-               super(MessageFormat.format(JGitText.get().packFileInvalid, path.getAbsolutePath()));
+               this(path.getAbsolutePath());
+       }
+
+       /**
+        * Construct a pack invalid error.
+        *
+        * @param path
+        *            path of the invalid pack file.
+        */
+       public PackInvalidException(final String path) {
+               super(MessageFormat.format(JGitText.get().packFileInvalid, path));
        }
 }