<commit_before>/*
 * $Id$ 
 * IzPack - Copyright 2001-2008 <NAME>, All Rights Reserved.
 * 
 * http://izpack.org/
 * http://izpack.codehaus.org/
 * 
 * Copyright 2002 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.izforge.izpack.util;

import java.io.*;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.ArrayList;
import java.util.List;

/*---------------------------------------------------------------------------*/

/**
 * This class handles loading of native libraries. There must only be one instance of
 * <code>Librarian</code> per Java runtime, therefore this class is implemented as a 'Singleton'.
 * <br>
 * <br>
 * <code>Librarian</code> is capable of loading native libraries from a variety of different
 * source locations. However, you should place your library files in the 'native' directory. The
 * primary reason for supporting different source locations is to facilitate testing in a
 * development environment, without the need to actually packing the application into a *.jar file.
 *
 * @author <NAME>
 * @version 1.0 / 1/30/02
 */
/*---------------------------------------------------------------------------*/
public class Librarian implements CleanupClient
{

    // ------------------------------------------------------------------------
    // Constant Definitions
    // ------------------------------------------------------------------------

    /**
     * Used to identify jar URL protocols
     */
    private static final String JAR_PROTOCOL = "jar";

    /**
     * Used to identify file URL protocols
     */
    private static final String FILE_PROTOCOL = "file";

    /**
     * The key used to retrieve the location of temporary files form the system properties.
     */
    private static final String TEMP_LOCATION_KEY = "java.io.tmpdir";

    /**
     * The extension appended to the client name when searching for it as a resource. Since the
     * client is an object, the extension should always be '.class'
     */
    private static final String CLIENT_EXTENSION = ".class";

    /**
     * The default directory for native library files.
     */
    private static final String NATIVE = "native";<commit_msg>Fix for IZPACK-699<commit_after>/*
 * $Id$ 
 * IzPack - Copyright 2001-2008 <NAME>, All Rights Reserved.
 * 
 * http://izpack.org/
 * http://izpack.codehaus.org/
 * 
 * Copyright 2002 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.izforge.izpack.util;

import java.io.*;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.ArrayList;
import java.util.List;

/*---------------------------------------------------------------------------*/

/**
 * This class handles loading of native libraries. There must only be one instance of
 * <code>Librarian</code> per Java runtime, therefore this class is implemented as a 'Singleton'.
 * <br>
 * <br>
 * <code>Librarian</code> is capable of loading native libraries from a variety of different
 * source locations. However, you should place your library files in the 'native' directory. The
 * primary reason for supporting different source locations is to facilitate testing in a
 * development environment, without the need to actually packing the application into a *.jar file.
 *
 * @author <NAME>
 * @version 1.0 / 1/30/02
 */
/*---------------------------------------------------------------------------*/
public class Librarian implements CleanupClient
{

    // ------------------------------------------------------------------------
    // Constant Definitions
    // ------------------------------------------------------------------------

    /**
     * Used to identify jar URL protocols
     */
    private static final String JAR_PROTOCOL = "jar";

    /**
     * Used to identify file URL protocols
     */
    private static final String FILE_PROTOCOL = "file";

    /**
     * The key used to retrieve the location of temporary files form the system properties.
     */
    private static final String TEMP_LOCATION_KEY = "java.io.tmpdir";

    /**
     * The extension appended to the client name when searching for it as a resource. Since the
     * client is an object, the extension should always be '.class'
     */
    private static final String CLIENT_EXTENSION = ".class";

    /**
     * The default directory for native library files.
     */
    private static final String NATIVE = "com/izforge/izpack/bin/native";
{'fraction_non_alphanumeric': 0.18390603085553997, 'fraction_numerical': 0.008590462833099579, 'mean_word_length': 2.162416851441242, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6078903', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1344, 'n_words': 585}