aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-06-09 09:49:07 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-06-09 12:27:18 +0200
commit786380bd5e06719ce86990824760d4408e1ae565 (patch)
treebe5f74e82ab59a4ded895283291d278c19c9d056 /org.eclipse.jgit/src/org/eclipse/jgit/internal/transport
parentf24ad3da66a0ea86f5674fac9442d3b4e4c78aa2 (diff)
downloadjgit-786380bd5e06719ce86990824760d4408e1ae565.tar.gz
jgit-786380bd5e06719ce86990824760d4408e1ae565.zip
Warn if configured cookie file is missing
We logged a stack trace if the configured http.cookieFile was missing. Instead only log a warning. Bug: 548081 Change-Id: I42e39f5ad8ffce7b43162e5068f60af073b8a126 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/internal/transport')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java
index 93be5c69e3..075f55c733 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java
@@ -344,6 +344,11 @@ public final class NetscapeCookieFile {
final int maxStaleRetries = 5;
int retries = 0;
File file = getPath().toFile();
+ if (!file.exists()) {
+ LOG.warn(MessageFormat.format(JGitText.get().missingCookieFile,
+ file.getAbsolutePath()));
+ return new byte[0];
+ }
while (true) {
final FileSnapshot oldSnapshot = snapshot;
final FileSnapshot newSnapshot = FileSnapshot.save(file);