
com.star.io.resource.NoResourceException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
some utility class for java develop
The newest version!
package com.star.io.resource;
import com.star.exception.ExceptionUtil;
import com.star.exception.IORuntimeException;
import com.star.string.StringUtil;
/**
* 资源文件或资源不存在异常
*
* @author xiaoleilu
* @since 4.0.2
*/
public class NoResourceException extends IORuntimeException {
private static final long serialVersionUID = -623254467603299129L;
public NoResourceException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public NoResourceException(String message) {
super(message);
}
public NoResourceException(String messageTemplate, Object... params) {
super(StringUtil.format(messageTemplate, params));
}
public NoResourceException(String message, Throwable throwable) {
super(message, throwable);
}
public NoResourceException(Throwable throwable, String messageTemplate, Object... params) {
super(StringUtil.format(messageTemplate, params), throwable);
}
/**
* 导致这个异常的异常是否是指定类型的异常
*
* @param clazz 异常类
* @return 是否为指定类型异常
*/
@Override
public boolean causeInstanceOf(Class extends Throwable> clazz) {
Throwable cause = this.getCause();
return null != cause && clazz.isInstance(cause);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy