diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java b/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java index 48d0d8dd22e7707fb3869806bd6e98296d31eeed..c6fd50fb8a230d9067040dfdcbac4548ca482ca7 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java +++ b/common/source/java/ch/systemsx/cisd/common/utilities/FileUtilities.java @@ -928,6 +928,22 @@ public final class FileUtilities } } + /** + * Tries to copy a native library which is available as a resource to a temporary file. It will + * use the following naming schema to locate the resource containing the native library: + * <p> + * <code>/native/<libname>/<platform_id>/<libname>.so</code>. + * + * @param libraryName The name of the library. + * @return The name of the temporary file, or <code>null</code>, if the resource could not be + * copied. + */ + public final static String tryCopyNativeLibraryToTempFile(final String libraryName) + { + return tryCopyResourceToTempFile(String.format("/native/%s/%s/%s.so", libraryName, + OSUtilities.getComputerPlatform(), libraryName), libraryName, ".so"); + } + /** * Tries to copy the resource with the given name to a temporary file. *