1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-16 14:25:02 -05:00

* fix new 7zip integration for webstart

This commit is contained in:
Reinhard Pointner 2012-02-26 19:50:53 +00:00
parent 82471e029f
commit 4826948534
3 changed files with 17 additions and 3 deletions

View File

@ -47,10 +47,11 @@
<jar href="json-simple.jar" download="lazy" /> <jar href="json-simple.jar" download="lazy" />
<jar href="xmlrpc.jar" download="eager" /> <jar href="xmlrpc.jar" download="eager" />
<jar href="sublight-ws.jar" download="eager" /> <jar href="sublight-ws.jar" download="eager" />
<jar href="mediainfo.jar" download="lazy" part="native" /> <jar href="junrar-custom.jar" download="lazy" />
<jar href="nekohtml.jar" download="lazy" part="scraper" /> <jar href="nekohtml.jar" download="lazy" part="scraper" />
<jar href="xercesImpl.jar" download="lazy" part="scraper" /> <jar href="xercesImpl.jar" download="lazy" part="scraper" />
<jar href="junrar-custom.jar" download="lazy" /> <jar href="mediainfo.jar" download="lazy" part="native" />
<jar href="sevenzipjbinding.jar" download="lazy" part="native" />
</resources> </resources>
<resources os="Windows" arch="x86"> <resources os="Windows" arch="x86">

View File

@ -30,7 +30,14 @@ import net.sf.sevenzipjbinding.SevenZipException;
public class Archive implements Closeable { public class Archive implements Closeable {
static { private static boolean nativeLibrariesLoaded = false;
private static synchronized void requireNativeLibraries() {
if (nativeLibrariesLoaded) {
return;
}
// initialize 7z-JBinding native libs // initialize 7z-JBinding native libs
try { try {
if (Platform.isWindows()) { if (Platform.isWindows()) {
@ -39,16 +46,21 @@ public class Archive implements Closeable {
System.loadLibrary("lib7-Zip-JBinding"); System.loadLibrary("lib7-Zip-JBinding");
SevenZip.initLoadedLibraries(); SevenZip.initLoadedLibraries();
nativeLibrariesLoaded = true;
} catch (Throwable e) { } catch (Throwable e) {
Logger.getLogger(Archive.class.getName()).warning("Failed to load 7z-JBinding: " + e.getMessage()); Logger.getLogger(Archive.class.getName()).warning("Failed to load 7z-JBinding: " + e.getMessage());
} }
} }
private ISevenZipInArchive inArchive; private ISevenZipInArchive inArchive;
private Closeable openVolume; private Closeable openVolume;
public Archive(File file) throws SevenZipException, IOException { public Archive(File file) throws SevenZipException, IOException {
// initialize 7-Zip-JBinding
requireNativeLibraries();
if (!file.exists()) { if (!file.exists()) {
throw new FileNotFoundException(file.getAbsolutePath()); throw new FileNotFoundException(file.getAbsolutePath());
} }

View File

@ -127,6 +127,7 @@
various tasks that you can just run right away or further customize to your needs.</p> various tasks that you can just run right away or further customize to your needs.</p>
<ul> <ul>
<li>Watch media folders and organize new files automatically</li> <li>Watch media folders and organize new files automatically</li>
<li>Extract files from multi-volume rar archives</li>
<li>Fetch artwork and create nfo files for TV shows or movies</li> <li>Fetch artwork and create nfo files for TV shows or movies</li>
<li>Export your media files including media info as CSV text file</li> <li>Export your media files including media info as CSV text file</li>
... and more! ... and more!