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

com.zusmart.base.scanner.support.AbstractScannerResult Maven / Gradle / Ivy

Go to download

提供基础的工具类及方法类,Logging,Scanner,Buffer,NetWork,Future,Thread

There is a newer version: 1.0.6
Show newest version
package com.zusmart.base.scanner.support;

import java.util.jar.JarEntry;

import com.zusmart.base.scanner.ScannerResult;

public abstract class AbstractScannerResult implements ScannerResult {

	private final String name;
	private final String path;

	protected AbstractScannerResult(String name, String path) {
		this.name = name;
		this.path = path;
	}

	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public String getPath() {
		return this.path;
	}

	@Override
	public String toString() {
		return String.format("[%s-%s] %s", this.isFromDirFile() ? "DIR" : "JAR", this.getName(), this.getPath());
	}

	protected static String getFileName(JarEntry jarEntry) {
		String entryName = jarEntry.getName();
		int index = entryName.lastIndexOf("/");
		if (index >= 0) {
			entryName = entryName.substring(index + 1);
		}
		return entryName;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy