cziegeler 02/01/14 04:11:52 Modified: . build.xml src/java/org/apache/cocoon/components/url URLFactoryImpl.java Log: One further but small step towards optional compiling Revision Changes Path 1.134 +28 -12 xml-cocoon2/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/build.xml,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- build.xml 14 Jan 2002 11:15:44 -0000 1.133 +++ build.xml 14 Jan 2002 12:11:52 -0000 1.134 @@ -555,8 +555,13 @@ <mkdir dir="${build.dest}"/> <copy todir="${build.src}" filtering="on"> <fileset dir="${java.dir}"> - <exclude name="**/JSP*.java" unless="servlet.present"/> - <exclude name="**/servlet.sitemap" unless="servlet.present"/> + <exclude name="**/JSP*.java" unless="servlet.present"/> + <exclude name="**/Jsp*.java" unless="servlet.present"/> + <exclude name="**/servlet.sitemap" unless="servlet.present"/> + <exclude name="**/components/deli/**.java" unless="servlet.present"/> + <exclude name="**/servlet/*.java" unless="servlet.present"/> + <exclude name="**/environment/http/*.java" unless="servlet.present"/> + <exclude name="**/generation/StreamGenerator.java" unless="servlet.present"/> <exclude name="**/ScriptAction.java" unless="bsf.present"/> <exclude name="**/ScriptGenerator.java" unless="bsf.present"/> @@ -612,8 +617,6 @@ <exclude name="**/Jaxen*" unless="jaxen.present"/> - <exclude name="**/CocoonServlet*.java" unless="servlet.present"/> - <exclude name="**/components/hsqldb/ServerImpl.java" unless="hsqldb.present"/> <exclude name="**/components/search/*" unless="lucene.present"/> @@ -639,43 +642,56 @@ <!-- =================================================================== --> <!-- Prepares the servlet 2.3 source code if maybeupload is present --> <!-- =================================================================== --> - <target name="prepare-src-23-maybeupload" depends="prepare-src-main" if="maybeupload.present"> + <target name="prepare-src-23-maybeupload" if="servlet23.present, maybeupload.present"> <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapperMaybeUpload23.java" tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java" - filtering="on"/> + filtering="on" + overwrite="true"/> </target> <!-- =================================================================== --> <!-- Prepares the servlet 2.3 source code --> <!-- =================================================================== --> - <target name="prepare-src-23" depends="prepare-src-23-maybeupload,prepare-src-main" if="servlet23.present" unless="maybeupload.present"> + <target name="prepare-src-23" if="servlet23.present" unless="maybeupload.present"> <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapper23.java" tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java" - filtering="on"/> + filtering="on" + overwrite="true"/> </target> <!-- =================================================================== --> <!-- Prepares the servlet 2.2 source code if maybeupload is present --> <!-- =================================================================== --> - <target name="prepare-src-22-maybeupload" depends="prepare-src-main" if="maybeupload.present" unless="servlet23.present"> + <target name="prepare-src-22-maybeupload" unless="servlet23.present"> <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapperMaybeUpload22.java" tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java" - filtering="on"/> + filtering="on" + overwrite="true"/> </target> <!-- =================================================================== --> <!-- Prepares the servlet 2.2 source code --> <!-- =================================================================== --> - <target name="prepare-src-22" depends="prepare-src-22-maybeupload,prepare-src-23" unless="servlet23.present, maybeupload.present"> + <target name="prepare-src-22" unless="servlet23.present, maybeupload.present"> <copy file="${java.dir}/org/apache/cocoon/environment/http/RequestWrapper22.java" tofile="${build.src}/org/apache/cocoon/environment/http/RequestWrapper.java" filtering="on"/> </target> <!-- =================================================================== --> + <!-- Prepares the servlet source --> + <!-- =================================================================== --> + <target name="prepare-src-servlet" depends="prepare-src-main" if="servlet.present"> + <antcall target="prepare-src-22"/> + <antcall target="prepare-src-22-maybeupload"/> + <antcall target="prepare-src-23"/> + <antcall target="prepare-src-23-maybeupload"/> + </target> + + <!-- =================================================================== --> <!-- Prepares the source code --> <!-- =================================================================== --> - <target name="prepare-src" depends="prepare-src-22"/> + <target name="prepare-src" depends="prepare-src-servlet"/> <!-- =================================================================== --> <!-- Set a variable if the generated java code is already up-to-date. --> 1.2 +6 -10 xml-cocoon2/src/java/org/apache/cocoon/components/url/URLFactoryImpl.java Index: URLFactoryImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/url/URLFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- URLFactoryImpl.java 3 Jan 2002 12:31:15 -0000 1.1 +++ URLFactoryImpl.java 14 Jan 2002 12:11:52 -0000 1.2 @@ -22,7 +22,6 @@ import org.apache.avalon.framework.logger.Loggable; import org.apache.avalon.framework.thread.ThreadSafe; import org.apache.cocoon.Constants; -import org.apache.cocoon.environment.http.HttpContext; import org.apache.cocoon.util.ClassUtils; import java.io.File; @@ -35,10 +34,10 @@ /** * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a> - * @version $Id: URLFactoryImpl.java,v 1.1 2002/01/03 12:31:15 giacomo Exp $ + * @version $Id: URLFactoryImpl.java,v 1.2 2002/01/14 12:11:52 cziegeler Exp $ */ -public class URLFactoryImpl -extends AbstractLoggable +public class URLFactoryImpl +extends AbstractLoggable implements ThreadSafe, Configurable, Disposable, Composable, Contextualizable, URLFactory { /** @@ -85,12 +84,9 @@ getLogger().error("Making URL - ContextException in getURL",e); } - if(envContext instanceof HttpContext) { - getLogger().debug("Making URL relative to context:" + location); - String path = ((HttpContext)envContext).getRealPath(location); - if(path != null) - return (new File(path)).toURL(); - } + final String path = envContext.getRealPath(location); + if (path != null) + return (new File(path)).toURL(); getLogger().debug("Making URL a Resource:" + location); URL url = envContext.getResource(location);
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]