Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/lib/json/FileHandler.java b/bundleplugin/src/main/java/aQute/lib/json/FileHandler.java
index 2f0eea5..c024090 100644
--- a/bundleplugin/src/main/java/aQute/lib/json/FileHandler.java
+++ b/bundleplugin/src/main/java/aQute/lib/json/FileHandler.java
@@ -8,18 +8,19 @@
public class FileHandler extends Handler {
- @Override void encode(Encoder app, Object object, Map<Object, Type> visited)
- throws IOException, Exception {
+ @Override
+ void encode(Encoder app, Object object, Map<Object,Type> visited) throws IOException, Exception {
File f = (File) object;
- if ( !f.isFile())
- throw new RuntimeException("Encoding a file requires the file to exist and to be a normal file " + f );
-
+ if (!f.isFile())
+ throw new RuntimeException("Encoding a file requires the file to exist and to be a normal file " + f);
+
FileInputStream in = new FileInputStream(f);
try {
app.append('"');
Base64.encode(in, app);
app.append('"');
- } finally {
+ }
+ finally {
in.close();
}
}
@@ -29,7 +30,8 @@
FileOutputStream fout = new FileOutputStream(tmp);
try {
Base64.decode(new StringReader(s), fout);
- } finally {
+ }
+ finally {
fout.close();
}
return tmp;