summaryrefslogtreecommitdiff
path: root/java/src/BlobWriter.java
diff options
context:
space:
mode:
authoreea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 01:16:40 +0000
committereea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 01:16:40 +0000
commit810346d1068644561c0bfd0da3dd61f48a23b8a0 (patch)
tree5b2ceb1a4a6f30a394548dafb9beca56dd065d16 /java/src/BlobWriter.java
parentae01c7c3c9a8c5dfee220ec11a3c959c89787b75 (diff)
downloadATCD-810346d1068644561c0bfd0da3dd61f48a23b8a0.tar.gz
Made some small changes so that there won't be warnings on NT when
java.lang is imported or stuff is imported from a package that it's already a member of.
Diffstat (limited to 'java/src/BlobWriter.java')
-rw-r--r--java/src/BlobWriter.java32
1 files changed, 29 insertions, 3 deletions
diff --git a/java/src/BlobWriter.java b/java/src/BlobWriter.java
index 4c4d5d1d31b..4c419a15c1f 100644
--- a/java/src/BlobWriter.java
+++ b/java/src/BlobWriter.java
@@ -31,6 +31,23 @@ public class BlobWriter extends BlobHandler
this.returnCode_ = -1;
}
+ /*******************************
+ * This constructor should be used when using the basic HTTP 1.1
+ * authentication scheme
+ *******************************/
+ public BlobWriter (MessageBlock mb,
+ int length,
+ int offset,
+ String filename,
+ String authentication)
+ {
+ super (length, offset, filename);
+ this.mb_ = mb;
+ this.returnCode_ = -1;
+ this.authentication_ = authentication;
+ }
+
+
public int open (Object obj)
{
if (this.sendRequest () != 0)
@@ -88,8 +105,16 @@ public class BlobWriter extends BlobHandler
filename = "/" + this.filename_;
// Create the header, store the actual length in mesglen
- String mesg = this.requestPrefix_ + " " + filename + " " + this.requestSuffix_ + " " + this.length_ + "\n\n";
- System.out.print (mesg);
+ String mesg = this.requestPrefix_ + " " + filename + " " + this.requestSuffix_;
+
+ if (this.authentication_ != null) {
+ mesg += "Authorization: Basic " + JACE.Connection.HTTPHelper.EncodeBase64(this.authentication_) + '\n';
+
+ System.err.println("Real password: " + this.authentication_);
+ }
+ mesg += "Content-length: " + this.length_ + "\n\n";
+
+ ACE.DEBUG("Sending header: " + mesg);
try
{
@@ -181,11 +206,12 @@ public class BlobWriter extends BlobHandler
return this.returnCode_;
}
+ protected String authentication_ = null;
protected String protocol_ = "http://";
protected int bytesWritten_ = 0;
protected MessageBlock mb_ = null;
protected String requestPrefix_ = "PUT";
- protected String requestSuffix_ = "HTTP/1.0\nContent-length:";
+ protected String requestSuffix_ = "HTTP/1.0\n";
protected String replyPrefix_ = "HTTP/1.0";
protected int returnCode_;
}