cziegeler 01/07/13 04:27:04
Modified: src/org/apache/cocoon/components/source Tag:
cocoon_20_branch URLSource.java
src/org/apache/cocoon/components/url Tag: cocoon_20_branch
URLFactoryImpl.java
Log:
cocoon2 is now again jdk 1.2 compatible
Revision Changes Path
No revision
No revision
1.1.2.4 +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.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- URLSource.java 2001/07/07 19:08:07 1.1.2.3
+++ URLSource.java 2001/07/13 11:26:46 1.1.2.4
@@ -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.1.2.3 $ $Date: 2001/07/07 19:08:07 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/07/13 11:26:46 $
*/
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();
}
No revision
No revision
1.2.2.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.2.2.4
retrieving revision 1.2.2.5
diff -u -r1.2.2.4 -r1.2.2.5
--- URLFactoryImpl.java 2001/07/11 18:03:43 1.2.2.4
+++ URLFactoryImpl.java 2001/07/13 11:26:58 1.2.2.5
@@ -29,7 +29,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version $Id: URLFactoryImpl.java,v 1.2.2.4 2001/07/11 18:03:43 bloritsch Exp $
+ * @version $Id: URLFactoryImpl.java,v 1.2.2.5 2001/07/13 11:26:58 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]