瀏覽代碼

Add String form of PackInvalidException constructor

This way the path can be supplied as a string, without first
converting to a java.io.File.

Change-Id: I54d9bb9867556cd98b378c0762054b31497459cb
tags/v1.1.0.201109011030-rc2
Shawn O. Pearce 13 年之前
父節點
當前提交
d1f130f7f9
共有 1 個檔案被更改,包括 11 行新增1 行删除
  1. 11
    1
      org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java

+ 11
- 1
org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java 查看文件

@@ -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));
}
}

Loading…
取消
儲存