> + 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();
> + return tarFile;
> + }
This method seems pretty much identical to the previous one. Could you refactor
to reuse the code?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57/files#r12936854