Author: markt
Date: Tue Sep 29 18:53:40 2015
New Revision: 1705910
URL: http://svn.apache.org/viewvc?rev=1705910&view=rev
Log:
Code clean-up
File.canRead() includes a check for File.exists()
Modified:
tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java
tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
tomcat/trunk/java/org/apache/catalina/startup/ClassLoaderFactory.java
tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java
Modified: tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java?rev=1705910&r1=1705909&r2=1705910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java Tue Sep 29
18:53:40 2015
@@ -80,7 +80,7 @@ public class ValidatorTask extends BaseR
}
File file = new File(path, Constants.ApplicationWebXml);
- if ((!file.exists()) || (!file.canRead())) {
+ if (!file.canRead()) {
throw new BuildException("Cannot find web.xml");
}
Modified: tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java?rev=1705910&r1=1705909&r2=1705910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java Tue
Sep 29 18:53:40 2015
@@ -347,7 +347,7 @@ public class JAASMemoryLoginModule exten
file = new File(catalinaBase, pathname);
}
}
- if (!file.exists() || !file.canRead()) {
+ if (!file.canRead()) {
log.warn("Cannot load configuration file " +
file.getAbsolutePath());
return;
}
Modified: tomcat/trunk/java/org/apache/catalina/startup/ClassLoaderFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ClassLoaderFactory.java?rev=1705910&r1=1705909&r2=1705910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ClassLoaderFactory.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ClassLoaderFactory.java Tue
Sep 29 18:53:40 2015
@@ -85,7 +85,7 @@ public final class ClassLoaderFactory {
if (unpacked != null) {
for (int i = 0; i < unpacked.length; i++) {
File file = unpacked[i];
- if (!file.exists() || !file.canRead())
+ if (!file.canRead())
continue;
file = new File(file.getCanonicalPath() + File.separator);
URL url = file.toURI().toURL();
@@ -99,8 +99,7 @@ public final class ClassLoaderFactory {
if (packed != null) {
for (int i = 0; i < packed.length; i++) {
File directory = packed[i];
- if (!directory.isDirectory() || !directory.exists() ||
- !directory.canRead())
+ if (!directory.isDirectory() || !directory.canRead())
continue;
String filenames[] = directory.list();
for (int j = 0; j < filenames.length; j++) {
@@ -231,7 +230,7 @@ public final class ClassLoaderFactory {
private static boolean validateFile(File file,
RepositoryType type) throws IOException {
if (RepositoryType.DIR == type || RepositoryType.GLOB == type) {
- if (!file.exists() || !file.isDirectory() || !file.canRead()) {
+ if (!file.isDirectory() || !file.canRead()) {
String msg = "Problem with directory [" + file +
"], exists: [" + file.exists() +
"], isDirectory: [" + file.isDirectory() +
@@ -256,7 +255,7 @@ public final class ClassLoaderFactory {
return false;
}
} else if (RepositoryType.JAR == type) {
- if (!file.exists() || !file.canRead()) {
+ if (!file.canRead()) {
log.warn("Problem with JAR file [" + file +
"], exists: [" + file.exists() +
"], canRead: [" + file.canRead() + "]");
Modified: tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java?rev=1705910&r1=1705909&r2=1705910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java Tue Sep 29
18:53:40 2015
@@ -353,11 +353,7 @@ public final class UserConfig
File app = new File(home, directoryName);
if (!app.exists() || !app.isDirectory())
return;
- /*
- File dd = new File(app, "/WEB-INF/web.xml");
- if (!dd.exists() || !dd.isFile() || !dd.canRead())
- return;
- */
+
host.getLogger().info(sm.getString("userConfig.deploy", user));
// Deploy the web application for this user
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]