How can I read header encrypted 7zip archive?

Help
Anonymous
2013-02-23
2013-04-17
  • Anonymous - 2013-02-23

    Hi
    I have a question,
    When I read header encrypted 7zip/rar archives,
    then always SevenZipException is occur..

    I can't read any more
    please help 

    public void ReadArchiveFile(File sfile){
            RandomAccessFile   randomAccessFile = null;
            ISevenZipInArchive inArchive = null;
            int encrypt_item_count = 0;
            try {
    randomAccessFile = new RandomAccessFile(sfile, "r");

    try{
             inArchive = SevenZip.openInArchive(null, // autodetect archive type
                                  new RandomAccessFileInStream(randomAccessFile));
    } catch ( SevenZipException e ){
             e.printStackTrace();  // always throws exception
             return;
    } finally{
                           …
                         }
    }

     
  • Boris Brodski

    Boris Brodski - 2013-02-24

    Hi!

    Just use this method of SevenZip class:

    public static ISevenZipInArchive openInArchive(ArchiveFormat archiveFormat,
                                                   IInStream inStream,
                                                   java.lang.String passwordForOpen)
                                            throws SevenZipException;

    http://sevenzipjbind.sourceforge.net/javadoc/net/sf/sevenzipjbinding/SevenZip.html#openInArchive(net.sf.sevenzipjbinding.ArchiveFormat, net.sf.sevenzipjbinding.IInStream, java.lang.String)

    Regards,
    Boris Brodski

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks