You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Hans Ulrich Niedermann <ni...@isd.uni-stuttgart.de> on 2000/09/15 02:26:57 UTC
[C2] Small patch to Main.java
Hi,
a small patch to org.apache.cocoon.Main (correcting only some
typos). Not really tested, but at least it compiles :-)
Uli
----8<------------------------------------------------------------
Index: src/org/apache/cocoon/Main.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/Attic/Main.java,v
retrieving revision 1.1.4.3
diff -c -r1.1.4.3 Main.java
*** src/org/apache/cocoon/Main.java 2000/09/03 17:45:45 1.1.4.3
--- src/org/apache/cocoon/Main.java 2000/09/15 00:20:02
***************
*** 215,221 ****
* this method is the following:
*
* <ul>
! * <li>the link view of the given URI is called and the resourced linked
* to the requested one are obtained.</li>
* <li>for each link, this method is recursively called and returns
* the file used to save the resource on disk.</li>
--- 215,221 ----
* this method is the following:
*
* <ul>
! * <li>the link view of the given URI is called and the resources linked
* to the requested one are obtained.</li>
* <li>for each link, this method is recursively called and returns
* the file used to save the resource on disk.</li>
***************
*** 223,229 ****
* view of the resource is called to obtain a link-translated version
* of the resource with the given link map</li>
* <li>the resource is saved on disk and the URI MIME type is checked for
! * consistenci with the URI and, if the extention is inconsistent
* or absent, the file is renamed</li>
* <li>then the file name of the translated URI is returned</li>
* </ul>
--- 223,229 ----
* view of the resource is called to obtain a link-translated version
* of the resource with the given link map</li>
* <li>the resource is saved on disk and the URI MIME type is checked for
! * consistency with the URI and, if the extension is inconsistent
* or absent, the file is renamed</li>
* <li>then the file name of the translated URI is returned</li>
* </ul>
***************
*** 244,250 ****
String type = getPage(uri, translatedLinks, output);
output.close();
! if (!matchesExtention(uri, type)) {
outputFile.renameTo(getFile(uri, type));
}
--- 244,250 ----
String type = getPage(uri, translatedLinks, output);
output.close();
! if (!matchesExtension(uri, type)) {
outputFile.renameTo(getFile(uri, type));
}
***************
*** 271,277 ****
return new File(destDir, uri + File.separator + getExtension(type));
}
! boolean matchesExtention(String uri, String type) {
int dotindex = uri.lastIndexOf('.');
int slashindex = uri.indexOf('/', dotindex);
if ((dotindex != -1) && (slashindex == -1)) {
--- 271,277 ----
return new File(destDir, uri + File.separator + getExtension(type));
}
! boolean matchesExtension(String uri, String type) {
int dotindex = uri.lastIndexOf('.');
int slashindex = uri.indexOf('/', dotindex);
if ((dotindex != -1) && (slashindex == -1)) {
----8<------------------------------------------------------------
Re: [C2] Small patch to Main.java
Posted by Stefano Mazzocchi <st...@apache.org>.
Hans Ulrich Niedermann wrote:
>
> Hi,
>
> a small patch to org.apache.cocoon.Main (correcting only some
> typos). Not really tested, but at least it compiles :-)
>
> Uli
>
> ----8<------------------------------------------------------------
> Index: src/org/apache/cocoon/Main.java
> ===================================================================
> RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/Attic/Main.java,v
> retrieving revision 1.1.4.3
> diff -c -r1.1.4.3 Main.java
> *** src/org/apache/cocoon/Main.java 2000/09/03 17:45:45 1.1.4.3
> --- src/org/apache/cocoon/Main.java 2000/09/15 00:20:02
> ***************
> *** 215,221 ****
> * this method is the following:
> *
> * <ul>
> ! * <li>the link view of the given URI is called and the resourced linked
> * to the requested one are obtained.</li>
> * <li>for each link, this method is recursively called and returns
> * the file used to save the resource on disk.</li>
> --- 215,221 ----
> * this method is the following:
> *
> * <ul>
> ! * <li>the link view of the given URI is called and the resources linked
> * to the requested one are obtained.</li>
> * <li>for each link, this method is recursively called and returns
> * the file used to save the resource on disk.</li>
> ***************
> *** 223,229 ****
> * view of the resource is called to obtain a link-translated version
> * of the resource with the given link map</li>
> * <li>the resource is saved on disk and the URI MIME type is checked for
> ! * consistenci with the URI and, if the extention is inconsistent
> * or absent, the file is renamed</li>
> * <li>then the file name of the translated URI is returned</li>
> * </ul>
> --- 223,229 ----
> * view of the resource is called to obtain a link-translated version
> * of the resource with the given link map</li>
> * <li>the resource is saved on disk and the URI MIME type is checked for
> ! * consistency with the URI and, if the extension is inconsistent
> * or absent, the file is renamed</li>
> * <li>then the file name of the translated URI is returned</li>
> * </ul>
> ***************
> *** 244,250 ****
> String type = getPage(uri, translatedLinks, output);
> output.close();
>
> ! if (!matchesExtention(uri, type)) {
> outputFile.renameTo(getFile(uri, type));
> }
>
> --- 244,250 ----
> String type = getPage(uri, translatedLinks, output);
> output.close();
>
> ! if (!matchesExtension(uri, type)) {
> outputFile.renameTo(getFile(uri, type));
> }
>
> ***************
> *** 271,277 ****
> return new File(destDir, uri + File.separator + getExtension(type));
> }
>
> ! boolean matchesExtention(String uri, String type) {
> int dotindex = uri.lastIndexOf('.');
> int slashindex = uri.indexOf('/', dotindex);
> if ((dotindex != -1) && (slashindex == -1)) {
> --- 271,277 ----
> return new File(destDir, uri + File.separator + getExtension(type));
> }
>
> ! boolean matchesExtension(String uri, String type) {
> int dotindex = uri.lastIndexOf('.');
> int slashindex = uri.indexOf('/', dotindex);
> if ((dotindex != -1) && (slashindex == -1)) {
> ----8<------------------------------------------------------------
Patched. Thanks good eyes :)
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------