- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.catalina.WebResource.isFile()
方法的一些代码示例,展示了WebResource.isFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebResource.isFile()
方法的具体详情如下:
包路径:org.apache.catalina.WebResource
类名称:WebResource
方法名:isFile
[英]See java.io.File#isFile().
[中]参见java。伊奥。文件#isFile()。
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public boolean isFile() {
Boolean cachedIsFile = this.cachedIsFile;
if (cachedIsFile == null) {
cachedIsFile = Boolean.valueOf(webResource.isFile());
this.cachedIsFile = cachedIsFile;
}
return cachedIsFile.booleanValue();
}
代码示例来源:origin: codefollower/Tomcat-Research
@Override
public boolean isFile() {
Boolean cachedIsFile = this.cachedIsFile;
if (cachedIsFile == null) {
cachedIsFile = Boolean.valueOf(webResource.isFile());
this.cachedIsFile = cachedIsFile;
}
return cachedIsFile.booleanValue();
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public boolean isFile() {
Boolean cachedIsFile = this.cachedIsFile;
if (cachedIsFile == null) {
cachedIsFile = Boolean.valueOf(webResource.isFile());
this.cachedIsFile = cachedIsFile;
}
return cachedIsFile.booleanValue();
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
private List<PrecompressedResource> getAvailablePrecompressedResources(String path) {
List<PrecompressedResource> ret = new ArrayList<>(compressionFormats.length);
for (CompressionFormat format : compressionFormats) {
WebResource precompressedResource = resources.getResource(path + format.extension);
if (precompressedResource.exists() && precompressedResource.isFile()) {
ret.add(new PrecompressedResource(precompressedResource, format));
}
}
return ret;
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Check if sendfile can be used.
*/
protected boolean checkSendfile(HttpServletRequest request,
HttpServletResponse response,
WebResource resource,
long length, Range range) {
if (sendfileSize > 0
&& resource.isFile()
&& length > sendfileSize
&& (resource.getCanonicalPath() != null)
&& (Boolean.TRUE == request.getAttribute(Globals.SENDFILE_SUPPORTED_ATTR))
&& (request.getClass().getName().equals("org.apache.catalina.connector.RequestFacade"))
&& (response.getClass().getName().equals("org.apache.catalina.connector.ResponseFacade"))) {
request.setAttribute(Globals.SENDFILE_FILENAME_ATTR, resource.getCanonicalPath());
if (range == null) {
request.setAttribute(Globals.SENDFILE_FILE_START_ATTR, Long.valueOf(0L));
request.setAttribute(Globals.SENDFILE_FILE_END_ATTR, Long.valueOf(length));
} else {
request.setAttribute(Globals.SENDFILE_FILE_START_ATTR, Long.valueOf(range.start));
request.setAttribute(Globals.SENDFILE_FILE_END_ATTR, Long.valueOf(range.end + 1));
}
return true;
}
return false;
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
private List<PrecompressedResource> getAvailablePrecompressedResources(String path) {
List<PrecompressedResource> ret = new ArrayList<>(compressionFormats.length);
for (CompressionFormat format : compressionFormats) {
WebResource precompressedResource = resources.getResource(path + format.extension);
if (precompressedResource.exists() && precompressedResource.isFile()) {
ret.add(new PrecompressedResource(precompressedResource, format));
}
}
return ret;
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Determines the methods normally allowed for the resource.
*
*/
private StringBuilder determineMethodsAllowed(HttpServletRequest req) {
StringBuilder methodsAllowed = new StringBuilder();
WebResource resource = resources.getResource(getRelativePath(req));
if (!resource.exists()) {
methodsAllowed.append("OPTIONS, MKCOL, PUT, LOCK");
return methodsAllowed;
}
methodsAllowed.append("OPTIONS, GET, HEAD, POST, DELETE, TRACE");
methodsAllowed.append(", PROPPATCH, COPY, MOVE, LOCK, UNLOCK");
if (listings) {
methodsAllowed.append(", PROPFIND");
}
if (resource.isFile()) {
methodsAllowed.append(", PUT");
}
return methodsAllowed;
}
代码示例来源:origin: codefollower/Tomcat-Research
private void processWebInfLib() {
WebResource[] possibleJars = listResources("/WEB-INF/lib", false);
for (WebResource possibleJar : possibleJars) {
if (possibleJar.isFile() && possibleJar.getName().endsWith(".jar")) {
createWebResourceSet(ResourceSetType.CLASSES_JAR,
"/WEB-INF/classes", possibleJar.getURL(), "/");
}
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Get the readme file as a string.
*/
protected String getReadme(WebResource directory) {
if (readmeFile != null) {
WebResource resource = resources.getResource(
directory.getWebappPath() + readmeFile);
if (resource.isFile()) {
StringWriter buffer = new StringWriter();
InputStream is = resource.getInputStream();
copyRange(new InputStreamReader(is),
new PrintWriter(buffer));
return buffer.toString();
} else {
if (debug > 10)
log("readme '" + readmeFile + "' not found");
return null;
}
}
return null;
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public boolean resolveResource(int type, String name) {
WebResourceRoot resources = request.getContext().getResources();
WebResource resource = resources.getResource(name);
if (!resource.exists()) {
return false;
} else {
switch (type) {
case 0:
return resource.isDirectory();
case 1:
return resource.isFile();
case 2:
return resource.isFile() && resource.getContentLength() > 0;
default:
return false;
}
}
}
代码示例来源:origin: codefollower/Tomcat-Research
@Override
public boolean resolveResource(int type, String name) {
WebResourceRoot resources = request.getContext().getResources();
WebResource resource = resources.getResource(name);
if (!resource.exists()) {
return false;
} else {
switch (type) {
case 0:
return (resource.isDirectory());
case 1:
return (resource.isFile());
case 2:
return (resource.isFile() && resource.getContentLength() > 0);
default:
return false;
}
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public boolean resolveResource(int type, String name) {
WebResourceRoot resources = request.getContext().getResources();
WebResource resource = resources.getResource(name);
if (!resource.exists()) {
return false;
} else {
switch (type) {
case 0:
return resource.isDirectory();
case 1:
return resource.isFile();
case 2:
return resource.isFile() && resource.getContentLength() > 0;
default:
return false;
}
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* Class loader resources are handled by treating JARs in WEB-INF/lib as
* resource JARs (without the internal META-INF/resources/ prefix) mounted
* at WEB-INF/classes (rather than the web app root). This enables reuse
* of the resource handling plumbing.
*
* These resources are marked as class loader only so they are only used in
* the methods that are explicitly defined to return class loader resources.
* This prevents calls to getResource("/WEB-INF/classes") returning from one
* or more of the JAR files.
*
* @throws LifecycleException If an error occurs that should stop the web
* application from starting
*/
protected void processWebInfLib() throws LifecycleException {
WebResource[] possibleJars = listResources("/WEB-INF/lib", false);
for (WebResource possibleJar : possibleJars) {
if (possibleJar.isFile() && possibleJar.getName().endsWith(".jar")) {
createWebResourceSet(ResourceSetType.CLASSES_JAR,
"/WEB-INF/classes", possibleJar.getURL(), "/");
}
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Class loader resources are handled by treating JARs in WEB-INF/lib as
* resource JARs (without the internal META-INF/resources/ prefix) mounted
* at WEB-INF/classes (rather than the web app root). This enables reuse
* of the resource handling plumbing.
*
* These resources are marked as class loader only so they are only used in
* the methods that are explicitly defined to return class loader resources.
* This prevents calls to getResource("/WEB-INF/classes") returning from one
* or more of the JAR files.
*
* @throws LifecycleException If an error occurs that should stop the web
* application from starting
*/
protected void processWebInfLib() throws LifecycleException {
WebResource[] possibleJars = listResources("/WEB-INF/lib", false);
for (WebResource possibleJar : possibleJars) {
if (possibleJar.isFile() && possibleJar.getName().endsWith(".jar")) {
createWebResourceSet(ResourceSetType.CLASSES_JAR,
"/WEB-INF/classes", possibleJar.getURL(), "/");
}
}
}
代码示例来源:origin: stackoverflow.com
for (WebResource jar : jars) {
if (jar.getName().endsWith(".jar") && jar.isFile() && jar.canRead()) {
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Start the class loader.
*
* @exception LifecycleException if a lifecycle error occurs
*/
@Override
public void start() throws LifecycleException {
state = LifecycleState.STARTING_PREP;
WebResource classes = resources.getResource("/WEB-INF/classes");
if (classes.isDirectory() && classes.canRead()) {
localRepositories.add(classes.getURL());
}
WebResource[] jars = resources.listResources("/WEB-INF/lib");
for (WebResource jar : jars) {
if (jar.getName().endsWith(".jar") && jar.isFile() && jar.canRead()) {
localRepositories.add(jar.getURL());
jarModificationTimes.put(
jar.getName(), Long.valueOf(jar.getLastModified()));
}
}
state = LifecycleState.STARTED;
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* Start the class loader.
*
* @exception LifecycleException if a lifecycle error occurs
*/
@Override
public void start() throws LifecycleException {
state = LifecycleState.STARTING_PREP;
WebResource classes = resources.getResource("/WEB-INF/classes");
if (classes.isDirectory() && classes.canRead()) {
localRepositories.add(classes.getURL());
}
WebResource[] jars = resources.listResources("/WEB-INF/lib");
for (WebResource jar : jars) {
if (jar.getName().endsWith(".jar") && jar.isFile() && jar.canRead()) {
localRepositories.add(jar.getURL());
jarModificationTimes.put(
jar.getName(), Long.valueOf(jar.getLastModified()));
}
}
state = LifecycleState.STARTED;
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
private WebXml getTomcatWebXmlFragment(WebXmlParser webXmlParser) {
WebXml webXmlTomcatFragment = createWebXml();
webXmlTomcatFragment.setOverridable(true);
// Set to distributable else every app will be prevented from being
// distributable when the Tomcat fragment is merged with the main
// web.xml
webXmlTomcatFragment.setDistributable(true);
// When merging, the default welcome files are only used if the app has
// not defined any welcomes files.
webXmlTomcatFragment.setAlwaysAddWelcomeFiles(false);
WebResource resource = context.getResources().getResource(Constants.TomcatWebXml);
if (resource.isFile()) {
try {
InputSource source = new InputSource(resource.getURL().toURI().toString());
source.setByteStream(resource.getInputStream());
if (!webXmlParser.parseWebXml(source, webXmlTomcatFragment, false)) {
ok = false;
}
} catch (URISyntaxException e) {
log.error(sm.getString("contextConfig.tomcatWebXmlError"), e);
}
}
return webXmlTomcatFragment;
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
private WebXml getTomcatWebXmlFragment(WebXmlParser webXmlParser) {
WebXml webXmlTomcatFragment = createWebXml();
webXmlTomcatFragment.setOverridable(true);
// Set to distributable else every app will be prevented from being
// distributable when the Tomcat fragment is merged with the main
// web.xml
webXmlTomcatFragment.setDistributable(true);
// When merging, the default welcome files are only used if the app has
// not defined any welcomes files.
webXmlTomcatFragment.setAlwaysAddWelcomeFiles(false);
WebResource resource = context.getResources().getResource(Constants.TomcatWebXml);
if (resource.isFile()) {
try {
InputSource source = new InputSource(resource.getURL().toURI().toString());
source.setByteStream(resource.getInputStream());
if (!webXmlParser.parseWebXml(source, webXmlTomcatFragment, false)) {
ok = false;
}
} catch (URISyntaxException e) {
log.error(sm.getString("contextConfig.tomcatWebXmlError"), e);
}
}
return webXmlTomcatFragment;
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
protected void processAnnotationsWebResource(WebResource webResource,
WebXml fragment, boolean handlesTypesOnly,
Map<String,JavaClassCacheEntry> javaClassCache) {
if (webResource.isDirectory()) {
WebResource[] webResources =
webResource.getWebResourceRoot().listResources(
webResource.getWebappPath());
if (webResources.length > 0) {
if (log.isDebugEnabled()) {
log.debug(sm.getString(
"contextConfig.processAnnotationsWebDir.debug",
webResource.getURL()));
}
for (WebResource r : webResources) {
processAnnotationsWebResource(r, fragment, handlesTypesOnly, javaClassCache);
}
}
} else if (webResource.isFile() &&
webResource.getName().endsWith(".class")) {
try (InputStream is = webResource.getInputStream()) {
processAnnotationsStream(is, fragment, handlesTypesOnly, javaClassCache);
} catch (IOException e) {
log.error(sm.getString("contextConfig.inputStreamWebResource",
webResource.getWebappPath()),e);
} catch (ClassFormatException e) {
log.error(sm.getString("contextConfig.inputStreamWebResource",
webResource.getWebappPath()),e);
}
}
}
尝试启动 servlet 引擎时,出现以下错误: 8080端口免费 在启动服务期间发现此错误。 服务器中已启用 IPv6。 错误: Using CATALINA_BASE: /app/iw-hom
我在尝试调用 Tomcat 上的 shutdown.sh 时遇到此错误。Tomcat 在 192.168.1.240:8080 上的内部服务器上 堆栈跟踪是 Aug 29, 2016 5:14:09
在我的 Linux 服务器 (ubuntu) 中,tomcat 日志文件 catalina.out 会自动重命名为新文件名,例如。 catalina.out catalina.out.1 , cata
我正在尝试为其中一个设备编写驱动程序套件扩展。我没有关于如何为 mac os Catalina 编写驱动程序扩展的信息。 我得到的唯一文档是 DriverKit 引用:https://develope
我有一个 bash 脚本,一旦文件超过特定大小时,它会成功删除一个或多个 tomcat 日志目录(我们运行多个实例)的 catalina.out 文件。我每晚运行此脚本作为 cron 作业。它基本上看
在 tomcat 启动后,Hibernate 开始登录 catalina.out。 (( 由于我从 tomcat/conf/logging.properties 中删除了控制台处理程序,它已开始在 c
我只是想知道如果我想替换: "$CATALINA_OUT" 2>&1 & 要每天轮换日志 我应该用什么替换它。我的理解是: "$CATALINA_BASE"/logs/catalina.out 2>&
我有我作为 .pkg 分发的应用程序使用 pkgbuild 创建的文件和 productbuild .使用 macOS Catalina,这不再起作用。安装程序提示我正在尝试将内容安装到系统卷。 三周
我在 Netbeans 中实现了一个基于 SOAP 的 Web 服务。我在服务器端遇到了一些问题,它给我错误 500,内部错误,因为我无法自动调试它,它告诉我检查日志但是我的catalina.out
我的一台主机在 Mac OS Catalina 上运行,并且它经常用完磁盘空间...... 我已经安排了在那里运行的任务,并且每天它都会将文件上传到 /用户/labuser/我的文件夹并从该文件夹中删
我已经修改了 php.ini 文件以启用操作码缓存并重新启动 apache,但它在 phpinfo() 中无处可见。 php -v 说: PHP 7.4.1 (cli) (built: Dec 18
01-Jul-2018 20:00:33.968 SEVERE [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.core.Container
由于 stderr.log 中的以下错误消息,我无法启动 tomcat 5.5 服务器。有人可以帮助我吗,这是一种紧急情况。提前致谢。 java.lang.ClassNotFoundException
该项目正在顺利运行突然我在控制台日志中收到此错误。我使用的是 Tomcat 8.0.35 版。我已经尝试了从干净构建到更新项目的所有方法。我知道已经解决了一些问题,但没有一个解决方案对我有用。 jav
我正在使用 Eclipse 在 Apache Tomcat 服务器上部署应用程序修复服务,但问题似乎是该应用程序没有被复制到 webapps 文件夹中,即它没有被发布。 HTTPConnectionM
在 tomcat 服务器中,logs 文件夹包含这样的文件 localhost.YYYY-MM-DD.log:主机日志 host-manager.YYYY-MM-DD.log 和manager.Y
我的 Java 应用程序(Spring、Hibernate、MySQL)在 Tomcat 5.5 中运行 在对我的应用程序进行最后一组更改后,Tomcat 的 catalina.out 文件增长非常迅
我禁用了 SIP,但目录/usr/bin 无论如何都是写保护的。如何获得/usr/bin 的写权限?请不要建议切换到/usr/local/bin。 最佳答案 Catalina 有一个新的文件系统安排,
我尝试在 Spring 中使用 Apache Tomcat 7.0 编写一个简单的 hello world 程序。我收到以下错误,服务器进入停止状态。 SEVERE: A child containe
我无法初始化 log4j catalina 日志附加器 - 你知道我缺少什么吗?我知道这是一个基本问题,但我坚持这一点。我为 catalina 记录器添加了 org.apache.log4j.net.
我是一名优秀的程序员,十分优秀!