Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-level API #14

Open
mknecht opened this issue May 9, 2014 · 1 comment
Open

High-level API #14

mknecht opened this issue May 9, 2014 · 1 comment
Assignees

Comments

@mknecht
Copy link

mknecht commented May 9, 2014

I created a wrapper API so you can do the 80% cases in one line:

new JTar().unpackTar("path/to/my.tar", "/tmp/tartest/")
new JTar().unpackTarGz(new File(sourceDir, "my.tar.gz), targetDir)

Would you consider merging a pull request?

Currently, it does what I want: Unpack everything from a compressed or uncompressed tar into a directory. I'd extend the API for packing in case you want to include it. Suggestions welcome.

The code: https://github.com/mknecht/jtar/blob/master/src/main/java/org/kamranzafar/jtar/JTar.java
The tests: https://github.com/mknecht/jtar/blob/master/src/test/java/org/kamranzafar/jtar/JTarTest.java

@kamranzafar kamranzafar self-assigned this Nov 16, 2016
@erayerdin
Copy link

I'm not sure but this might also require for JTar class to be implemented as singleton since this might lead to a bunch of instances of JTar which can also cause memory leaks.

A careful approach is needed indeed. My suggestions is to implement this approach in another package and protect the original JTar class since it is definitely needed for low-level stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants