-4

I am looking for some pointers on how can I add a file into an existing .deb (debian) archive in Java ? Are there any libraries that I can use ?

aquitted-mind
  • 263
  • 1
  • 13

1 Answers1

0

You would have to unpack and repack the file. You can try running bash commands from java. The following answer suggests ways you can do that

Java - Running Bash Commands

Refer to the following answer on how to unpack and repack .deb files.

https://unix.stackexchange.com/questions/138188/easily-unpack-deb-edit-postinst-and-repack-deb

Edit:

For a java library to do the same look at apache commons-compress.

http://commons.apache.org/proper/commons-compress/

Community
  • 1
  • 1
nwarriorch
  • 337
  • 6
  • 16
  • Thank you. I am however looking to implement purely a java based solution that doesn't involve running bash commands. – aquitted-mind May 04 '17 at 01:04
  • oh then you should look at http://commons.apache.org/proper/commons-compress/ , apparently .deb files are implemented as an ar archive. – nwarriorch May 04 '17 at 01:44
  • Thanks will experiment with that. Seems to have some file name limitation hopefully it will work out. – aquitted-mind May 05 '17 at 00:04