cziegeler 01/07/13 04:25:06
Modified: src/org/apache/cocoon/components/source URLSource.java
src/org/apache/cocoon/components/url URLFactoryImpl.java
Log:
cocoon2 is now again jdk 1.2 compatible
Revision Changes Path
1.5 +6 -2
xml-cocoon2/src/org/apache/cocoon/components/source/URLSource.java
Index: URLSource.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/source/URLSource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- URLSource.java 2001/07/07 11:43:27 1.4
+++ URLSource.java 2001/07/13 11:24:48 1.5
@@ -31,7 +31,7 @@
* Description of a source which is described by an URL.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.4 $ $Date: 2001/07/07 11:43:27 $
+ * @version CVS $Revision: 1.5 $ $Date: 2001/07/13 11:24:48 $
*/
public final class URLSource
@@ -90,10 +90,12 @@
try {
if (this.connection == null) {
this.connection = this.url.openConnection();
- String userInfo = this.url.getUserInfo();
+ /* The following requires a jdk 1.3
+ String userInfo = this.url.getUserInfo();
if (this.url.getProtocol().startsWith("http") == true &&
userInfo != null) {
this.connection.setRequestProperty("Authorization","Basic
"+this.encodeBASE64(userInfo));
}
+ */
}
this.lastModificationDate = this.connection.getLastModified();
this.contentLength = this.connection.getContentLength();
@@ -134,10 +136,12 @@
} else {
if (this.connection == null) {
this.connection = this.url.openConnection();
+ /* The following requires a jdk 1.3
String userInfo = this.url.getUserInfo();
if (this.url.getProtocol().startsWith("http") == true && userInfo
!= null) {
this.connection.setRequestProperty("Authorization","Basic
"+encodeBASE64(userInfo));
}
+ */
}
return this.connection.getInputStream();
}
1.5 +2 -2
xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java
Index: URLFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- URLFactoryImpl.java 2001/07/11 18:07:17 1.4
+++ URLFactoryImpl.java 2001/07/13 11:25:00 1.5
@@ -29,7 +29,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version $Id: URLFactoryImpl.java,v 1.4 2001/07/11 18:07:17 bloritsch Exp $
+ * @version $Id: URLFactoryImpl.java,v 1.5 2001/07/13 11:25:00 cziegeler Exp $
*/
public class URLFactoryImpl extends AbstractLoggable implements URLFactory,
Component, Configurable, Contextualizable {
@@ -94,7 +94,7 @@
public URL getURL(URL base, String location) throws MalformedURLException {
if ( base != null ) {
if (base.getProtocol().equals("file")) {
- File temp = new File(base.getPath(), location);
+ File temp = new
File(base.toExternalForm().substring("file:".length()), location);
return getURL("file:" + temp.getAbsolutePath());
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]