aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java
new file mode 100644
index 0000000000..cae808f546
--- /dev/null
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/SilentFileInputStream.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2018, David Pursehouse <david.pursehouse@gmail.com> 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.util.io;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * An implementation of FileInputStream that ignores any exceptions on close().
+ *
+ * @since 5.0
+ */
+public class SilentFileInputStream extends FileInputStream {
+ /**
+ * @param file
+ * the file
+ * @throws FileNotFoundException
+ * the file was not found
+ */
+ public SilentFileInputStream(File file) throws FileNotFoundException {
+ super(file);
+ }
+
+ @Override
+ public void close() {
+ try {
+ super.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+}