Search in sources :

Example 11 with WebResourceSet

use of org.apache.catalina.WebResourceSet in project tomcat by apache.

the class TestDirResourceSet method getWebResourceRoot.

@Override
public WebResourceRoot getWebResourceRoot() {
    TesterWebResourceRoot root = new TesterWebResourceRoot();
    WebResourceSet webResourceSet = new DirResourceSet(root, "/", getBaseDir().getAbsolutePath(), "/");
    webResourceSet.setReadOnly(false);
    root.setMainResources(webResourceSet);
    return root;
}
Also used : WebResourceSet(org.apache.catalina.WebResourceSet)

Example 12 with WebResourceSet

use of org.apache.catalina.WebResourceSet in project tomcat by apache.

the class TestDirResourceSetInternal method getWebResourceRoot.

@Override
public WebResourceRoot getWebResourceRoot() {
    TesterWebResourceRoot root = new TesterWebResourceRoot();
    WebResourceSet webResourceSet = new DirResourceSet(root, "/", tempDir.toAbsolutePath().toString(), "/dir1");
    root.setMainResources(webResourceSet);
    return root;
}
Also used : WebResourceSet(org.apache.catalina.WebResourceSet)

Example 13 with WebResourceSet

use of org.apache.catalina.WebResourceSet in project tomcat by apache.

the class TestDirResourceSetReadOnly method getWebResourceRoot.

@Override
public WebResourceRoot getWebResourceRoot() {
    TesterWebResourceRoot root = new TesterWebResourceRoot();
    WebResourceSet webResourceSet = new DirResourceSet(root, "/", getBaseDir().getAbsolutePath(), "/");
    webResourceSet.setReadOnly(true);
    root.setMainResources(webResourceSet);
    return root;
}
Also used : WebResourceSet(org.apache.catalina.WebResourceSet)

Example 14 with WebResourceSet

use of org.apache.catalina.WebResourceSet in project tomcat by apache.

the class TestDirResourceSetVirtual method getWebResourceRoot.

@Override
public WebResourceRoot getWebResourceRoot() {
    TesterWebResourceRoot root = new TesterWebResourceRoot();
    WebResourceSet webResourceSet = new DirResourceSet(new TesterWebResourceRoot(), "/", getBaseDir().getAbsolutePath(), "/");
    root.setMainResources(webResourceSet);
    WebResourceSet f1 = new FileResourceSet(root, "/f1.txt", dir1.getAbsolutePath() + "/f1.txt", "/");
    root.addPreResources(f1);
    WebResourceSet f2 = new FileResourceSet(root, "/f2.txt", dir1.getAbsolutePath() + "/f2.txt", "/");
    root.addPreResources(f2);
    WebResourceSet d1 = new DirResourceSet(root, "/d1", dir1.getAbsolutePath() + "/d1", "/");
    root.addPreResources(d1);
    WebResourceSet d2 = new DirResourceSet(root, "/d2", dir1.getAbsolutePath() + "/d2", "/");
    root.addPreResources(d2);
    return root;
}
Also used : WebResourceSet(org.apache.catalina.WebResourceSet)

Example 15 with WebResourceSet

use of org.apache.catalina.WebResourceSet in project tomcat by apache.

the class StandardRoot method startInternal.

@Override
protected void startInternal() throws LifecycleException {
    mainResources.clear();
    main = createMainResourceSet();
    mainResources.add(main);
    for (List<WebResourceSet> list : allResources) {
        // Skip class resources since they are started below
        if (list != classResources) {
            for (WebResourceSet webResourceSet : list) {
                webResourceSet.start();
            }
        }
    }
    // This has to be called after the other resources have been started
    // else it won't find all the matching resources
    processWebInfLib();
    // Need to start the newly found resources
    for (WebResourceSet classResource : classResources) {
        classResource.start();
    }
    cache.enforceObjectMaxSizeLimit();
    setState(LifecycleState.STARTING);
}
Also used : WebResourceSet(org.apache.catalina.WebResourceSet)

Aggregations

WebResourceSet (org.apache.catalina.WebResourceSet)21 File (java.io.File)8 IOException (java.io.IOException)3 WebResource (org.apache.catalina.WebResource)3 LinkedList (java.util.LinkedList)2 TrackedWebResource (org.apache.catalina.TrackedWebResource)2 WebResourceRoot (org.apache.catalina.WebResourceRoot)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 JarFile (java.util.jar.JarFile)1 Host (org.apache.catalina.Host)1 Loader (org.apache.catalina.Loader)1 WebappLoader (org.apache.catalina.loader.WebappLoader)1 DeploymentLoader (org.apache.openejb.config.DeploymentLoader)1 Test (org.junit.Test)1