From 4826948534397458c01630f1e89cd09b3b5ecec0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 26 Feb 2012 19:50:53 +0000 Subject: [PATCH] * fix new 7zip integration for webstart --- installer/webstart/filebot.jnlp | 5 +++-- .../net/sourceforge/filebot/archive/Archive.java | 14 +++++++++++++- website/index.html | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/installer/webstart/filebot.jnlp b/installer/webstart/filebot.jnlp index 03d59fa7..c2e8bbed 100644 --- a/installer/webstart/filebot.jnlp +++ b/installer/webstart/filebot.jnlp @@ -47,10 +47,11 @@ - + - + + diff --git a/source/net/sourceforge/filebot/archive/Archive.java b/source/net/sourceforge/filebot/archive/Archive.java index 697330be..92167aae 100644 --- a/source/net/sourceforge/filebot/archive/Archive.java +++ b/source/net/sourceforge/filebot/archive/Archive.java @@ -30,7 +30,14 @@ import net.sf.sevenzipjbinding.SevenZipException; public class Archive implements Closeable { - static { + private static boolean nativeLibrariesLoaded = false; + + + private static synchronized void requireNativeLibraries() { + if (nativeLibrariesLoaded) { + return; + } + // initialize 7z-JBinding native libs try { if (Platform.isWindows()) { @@ -39,16 +46,21 @@ public class Archive implements Closeable { System.loadLibrary("lib7-Zip-JBinding"); SevenZip.initLoadedLibraries(); + nativeLibrariesLoaded = true; } catch (Throwable e) { Logger.getLogger(Archive.class.getName()).warning("Failed to load 7z-JBinding: " + e.getMessage()); } } + private ISevenZipInArchive inArchive; private Closeable openVolume; public Archive(File file) throws SevenZipException, IOException { + // initialize 7-Zip-JBinding + requireNativeLibraries(); + if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } diff --git a/website/index.html b/website/index.html index 08f0051e..8cd3f6a3 100644 --- a/website/index.html +++ b/website/index.html @@ -127,6 +127,7 @@ various tasks that you can just run right away or further customize to your needs.

  • Watch media folders and organize new files automatically
  • +
  • Extract files from multi-volume rar archives
  • Fetch artwork and create nfo files for TV shows or movies
  • Export your media files including media info as CSV text file
  • ... and more!