> +      tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
> +      for (File file : files) {
> +         TarArchiveEntry tarEntry = new TarArchiveEntry(file);
> +         tarEntry.setName("/" + 
> getLast(Splitter.on(token).split(file.toString())));
> +         tos.putArchiveEntry(tarEntry);
> +         if (!file.isDirectory()) {
> +            FileInputStream fin = new FileInputStream(file);
> +            BufferedInputStream in = new BufferedInputStream(fin);
> +            while ((len = in.read(buf)) != -1) {
> +               tos.write(buf, 0, len);
> +            }
> +            in.close();
> +         }
> +         tos.closeArchiveEntry();
> +      }
> +      tos.close();

Close this in a finally block?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57/files#r12936813

Reply via email to