All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dragome.commons.compiler.classpath.InsideJarClasspathFile Maven / Gradle / Ivy

The newest version!
package com.dragome.commons.compiler.classpath;

import java.io.IOException;
import java.io.InputStream;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

public class InsideJarClasspathFile extends AbstractClasspathFile implements ClasspathFile
{
	private JarEntry entry;
	private JarFile jarFile;

	public String getFilename()
	{
		return entry.getName();
	}

	public InsideJarClasspathFile(JarFile jarFile, JarEntry entry, String path)
	{
		super(path);
		this.jarFile= jarFile;

		this.entry= entry;

		lastModified= entry.getTime();
	}

	public InputStream openInputStream()
	{
		try
		{
			return inputStream= jarFile.getInputStream(entry);
		}
		catch (IOException e)
		{
			throw new RuntimeException(e);
		}
	}

	public long getCRC()
	{
		return entry.getCrc();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy