// Path: tools/loader/src/main/java/com/kumuluz/ee/loader/exception/EeClassLoaderException.java
// public class EeClassLoaderException extends RuntimeException {
// 
//     public EeClassLoaderException(String message) {
//         super(message);
//     }
// 
//     public EeClassLoaderException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public String getMessageAll() {
//         StringBuilder stringBuilder = new StringBuilder();
// 
//         for (Throwable e = this;  e != null;  e = e.getCause()) {
//             if (stringBuilder.length() > 0) {
//                 stringBuilder.append(" / ");
//             }
// 
//             String message = e.getMessage();
//             if (message == null  ||  message.length() == 0) {
//                 message = e.getClass().getSimpleName();
//             }
// 
//             stringBuilder.append(message);
//         }
// 
//         return stringBuilder.toString();
//     }
// }


import java.util.jar.JarEntry;
import com.kumuluz.ee.loader.exception.EeClassLoaderException;
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

    public void setJarFileInfo(JarFileInfo jarFileInfo) {
        this.jarFileInfo = jarFileInfo;
    }

    public JarEntry getJarEntry() {
        return jarEntry;
    }

    public void setJarEntry(JarEntry jarEntry) {
        this.jarEntry = jarEntry;
    }

    public URL getURL() { // used in findResource() and findResources()
        try {
            String jarFileName = new File(jarFileInfo.getJarFile().getName()).toURI().toString();
            URI uri = new URI("jar:" + jarFileName + "!/" + jarEntry);
            return uri.toURL();
        } catch (URISyntaxException | MalformedURLException e) {
            return null;
        }
    }

    public String getName() { // used in createTempFile() and loadJar()
        return jarEntry.getName().replace('/', '_');
    }

    /**
     * Read JAR entry and return byte array of this JAR entry.
     */
// Path: tools/loader/src/main/java/com/kumuluz/ee/loader/exception/EeClassLoaderException.java
// public class EeClassLoaderException extends RuntimeException {
// 
//     public EeClassLoaderException(String message) {
//         super(message);
//     }
// 
//     public EeClassLoaderException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public String getMessageAll() {
//         StringBuilder stringBuilder = new StringBuilder();
// 
//         for (Throwable e = this;  e != null;  e = e.getCause()) {
//             if (stringBuilder.length() > 0) {
//                 stringBuilder.append(" / ");
//             }
// 
//             String message = e.getMessage();
//             if (message == null  ||  message.length() == 0) {
//                 message = e.getClass().getSimpleName();
//             }
// 
//             stringBuilder.append(message);
//         }
// 
//         return stringBuilder.toString();
//     }
// }


// Path: tools/loader/src/main/java/com/kumuluz/ee/loader/jar/JarEntryInfo.java
import java.util.jar.JarEntry;
import com.kumuluz.ee.loader.exception.EeClassLoaderException;
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;


    public void setJarFileInfo(JarFileInfo jarFileInfo) {
        this.jarFileInfo = jarFileInfo;
    }

    public JarEntry getJarEntry() {
        return jarEntry;
    }

    public void setJarEntry(JarEntry jarEntry) {
        this.jarEntry = jarEntry;
    }

    public URL getURL() { // used in findResource() and findResources()
        try {
            String jarFileName = new File(jarFileInfo.getJarFile().getName()).toURI().toString();
            URI uri = new URI("jar:" + jarFileName + "!/" + jarEntry);
            return uri.toURL();
        } catch (URISyntaxException | MalformedURLException e) {
            return null;
        }
    }

    public String getName() { // used in createTempFile() and loadJar()
        return jarEntry.getName().replace('/', '_');
    }

    /**
     * Read JAR entry and return byte array of this JAR entry.
     */
    public byte[] getJarBytes() throws EeClassLoaderException {