View | Details | Raw Unified | Return to bug 38131
Collapse All | Expand All

(-)file_not_specified_in_diff (-11 / +19 lines)
Line  Link Here
0
-- HostConfig.java     2007-05-04 22:43:38.000000000 -0300
0
++ HostConfig2.java    2007-11-06 02:51:43.421875000 -0400
Lines 1-3 Link Here
1
package org.apache.catalina.startup;
1
/*
2
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * contributor license agreements.  See the NOTICE file distributed with
Lines 15-37 Link Here
15
 * limitations under the License.
16
 * limitations under the License.
16
 */
17
 */
17
18
package org.apache.catalina.startup;
19
20
21
import java.io.BufferedOutputStream;
18
import java.io.BufferedOutputStream;
22
import java.io.File;
19
import java.io.File;
23
import java.io.FileOutputStream;
20
import java.io.FileOutputStream;
24
import java.io.IOException;
21
import java.io.IOException;
25
import java.io.InputStream;
22
import java.io.InputStream;
26
import java.util.ArrayList;
23
import java.util.ArrayList;
24
import java.util.Arrays;
27
import java.util.HashMap;
25
import java.util.HashMap;
28
import java.util.LinkedHashMap;
26
import java.util.LinkedHashMap;
29
import java.util.jar.JarEntry;
27
import java.util.jar.JarEntry;
30
import java.util.jar.JarFile;
28
import java.util.jar.JarFile;
31
import javax.management.ObjectName;
29
import javax.management.ObjectName;
32
30
import org.apache.catalina.core.StandardContext;
31
import org.apache.catalina.core.StandardHost;
33
import org.apache.catalina.Container;
32
import org.apache.catalina.Container;
34
import org.apache.catalina.Context;
33
import org.apache.catalina.Context;
35
import org.apache.catalina.Engine;
34
import org.apache.catalina.Engine;
Lines 39-46 Link Here
39
import org.apache.catalina.Lifecycle;
38
import org.apache.catalina.Lifecycle;
40
import org.apache.catalina.LifecycleEvent;
39
import org.apache.catalina.LifecycleEvent;
41
import org.apache.catalina.LifecycleListener;
40
import org.apache.catalina.LifecycleListener;
41
import org.apache.catalina.startup.Constants;
42
import org.apache.catalina.startup.ExpandWar;
42
import org.apache.catalina.core.ContainerBase;
43
import org.apache.catalina.core.ContainerBase;
43
import org.apache.catalina.core.StandardHost;
44
import org.apache.catalina.util.StringManager;
44
import org.apache.catalina.util.StringManager;
45
import org.apache.tomcat.util.digester.Digester;
45
import org.apache.tomcat.util.digester.Digester;
46
import org.apache.tomcat.util.modeler.Registry;
46
import org.apache.tomcat.util.modeler.Registry;
Lines 636-646 Link Here
636
                    name = path;
636
                    name = path;
637
                }
637
                }
638
            }
638
            }
639
            File expandedDocBase = new File(name);
639
            //default to appBase dir + name
640
            File warDocBase = new File(name + ".war");
640
            File expandedDocBase = new File(appBase(), name);
641
            if (context.getDocBase() != null) {
642
                // first assume docBase is absolute
643
                expandedDocBase = new File(context.getDocBase());
641
            if (!expandedDocBase.isAbsolute()) {
644
            if (!expandedDocBase.isAbsolute()) {
642
                expandedDocBase = new File(appBase(), name);
645
                    // if docBase specified and relative, it must be relative to appBase
643
                warDocBase = new File(appBase(), name + ".war");
646
                    expandedDocBase = new File(appBase(), context.getDocBase());
647
                }
644
            }
648
            }
645
            // Add the eventual unpacked WAR and all the resources which will be
649
            // Add the eventual unpacked WAR and all the resources which will be
646
            // watched inside it
650
            // watched inside it
Lines 652-657 Link Here
652
                addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context);
656
                addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context);
653
            } else {
657
            } else {
654
                // Find an existing matching war and expanded folder
658
                // Find an existing matching war and expanded folder
659
                File warDocBase = new File(expandedDocBase.getAbsolutePath() + ".war");
655
                if (warDocBase.exists()) {
660
                if (warDocBase.exists()) {
656
                    deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
661
                    deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
657
                            new Long(warDocBase.lastModified()));
662
                            new Long(warDocBase.lastModified()));
Lines 966-974 Link Here
966
                if (docBase != null) {
971
                if (docBase != null) {
967
                    resource = new File(docBaseFile, watchedResources[i]);
972
                    resource = new File(docBaseFile, watchedResources[i]);
968
                } else {
973
                } else {
974
                    log.debug("Ignoring non-existent WatchedResource '" + resource.getAbsolutePath() + "'");
969
                    continue;
975
                    continue;
970
                }
976
                }
971
            }
977
            }
978
            log.debug("Watching WatchedResource '" + resource.getAbsolutePath() + "'");
972
            app.reloadResources.put(resource.getAbsolutePath(),
979
            app.reloadResources.put(resource.getAbsolutePath(),
973
                    new Long(resource.lastModified()));
980
                    new Long(resource.lastModified()));
974
        }
981
        }
Lines 1329-1331 Link Here
1329
    }
1336
    }
1330
}
1337
}
1338

Return to bug 38131