Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 8944 invoked by uid 500); 14 Jul 2002 15:44:08 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 8933 invoked from network); 14 Jul 2002 15:44:07 -0000 Date: Sun, 14 Jul 2002 17:44:14 +0200 From: Bernhard Huber Subject: Re: work-directory To: cocoon-dev@xml.apache.org Message-id: <3D319C4E.8050203@a1.net> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020510 References: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Nicole Natho wrote: >Hello! > >We try to unterstand the init()-methode of CocoonServlet. There we found >the following snippet: > > >// first init the work-directory for the logger. >// this is required if we are running inside a war file! >final String workDirParam = conf.getInitParameter("work-directory"); > if ((workDirParam != null) && (!workDirParam.trim().equals(""))) { > if (this.servletContextPath == null) { > this.workDir = new File(workDirParam); > } else { > this.workDir = IOUtils.createFile( new >File(servletContextPath) , workDirParam); > } > this.workDir.mkdirs(); > } else { > this.workDir = (File) >this.servletContext.getAttribute("javax.servlet.context.tempdir"); > this.workDir = new File(workDir, "cocoon-files"); > this.workDir.mkdirs(); > } > >But after execution, we don't find the /WEB-INF/work directory. We don't >find the entry in the web.xml ( work-directory >... /WEB-INF/work ...), too. >We thought this snippet create some file anyway, because of the >mkdirs()-methode in the else-clause. Or did we misunderstand something? > > Where do I find Cocoon's work directory

Cocoon needs a working directory for storing internal caching files, storing uploaded files, etc.

You may specify the working explicitly by setting the servlet deployment init parameter work-directory. Setting this option you hava full control over the location of the working directory.

If you don't set the deployment init paramter work-directory, Cocoon tries to find a suitable working directory. The exact location of the working directory depends on the deployment mode used by the servlet container.

In case of deploying Cocoon in a "exploded directory" mode, the working directory is put relative to the servlet context path.

In case of deploying Cocoon in a war mode, and the servlet container does not unpack the war file into a directory, Cocoon uses the servlet attribute javax.servlet.context.tempdir as the root directory for its cocoon-files directory. The working files and directories are located relative to the cocoon-file directory.

As defined in the servlet specification each web application has its own temporary directory for writing tempory files. The servlet attribute javax.servlet.context.tempdir defines the location of the servlet application temporary directory. Thus Cocoon uses this directory for defining a directory cocoon-files. The directory is used for storing Cocoon working directories, and working files.

In case of tomcat check tomcat's work directory... bye bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org