com.zusmart.base.scanner.support.ScannerResultForJarResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zusmart-base Show documentation
Show all versions of zusmart-base Show documentation
提供基础的工具类及方法类,Logging,Scanner,Buffer,NetWork,Future,Thread
package com.zusmart.base.scanner.support;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import com.zusmart.base.scanner.ScannerResultForResource;
public class ScannerResultForJarResource extends AbstractScannerResult implements ScannerResultForResource {
protected ScannerResultForJarResource(JarFile jarFile, JarEntry jarEntry, String path) {
super(getFileName(jarEntry), path);
}
@Override
public boolean isClass() {
return false;
}
@Override
public boolean isResource() {
return true;
}
@Override
public boolean isFromJarFile() {
return true;
}
@Override
public boolean isFromDirFile() {
return false;
}
@Override
public InputStream getInputStream() throws IOException {
URL url = new URL(this.getPath());
return url.openStream();
}
}