public class HTTPOutputStream extends GlobusOutputStream
Modifier and Type | Field and Description |
---|---|
protected boolean |
append |
private static byte[] |
CRLF |
private static int |
DEFAULT_TIME |
protected java.io.InputStream |
in |
private static org.apache.commons.logging.Log |
logger |
protected java.io.OutputStream |
output |
protected long |
size |
protected java.net.Socket |
socket |
Modifier | Constructor and Description |
---|---|
protected |
HTTPOutputStream()
Private constructor used by subclasses.
|
|
HTTPOutputStream(java.lang.String host,
int port,
java.lang.String file,
long length,
boolean append)
Opens HTTP output stream (unsecure)
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts transfer.
|
private void |
checkForReply() |
void |
close() |
private void |
closeSocket() |
private void |
finish() |
void |
flush() |
private void |
init(java.lang.String host,
int port,
java.lang.String file,
long length,
boolean append) |
protected void |
put(java.lang.String host,
java.lang.String file,
long length,
int waittime) |
private void |
sleep(int time) |
void |
write(byte[] msg) |
void |
write(byte[] msg,
int from,
int length) |
void |
write(int b) |
private static org.apache.commons.logging.Log logger
private static final byte[] CRLF
private static final int DEFAULT_TIME
protected java.io.OutputStream output
protected java.io.InputStream in
protected java.net.Socket socket
protected long size
protected boolean append
protected HTTPOutputStream()
public HTTPOutputStream(java.lang.String host, int port, java.lang.String file, long length, boolean append) throws GassException, java.io.IOException
host
- host name of the HTTP server.port
- port number of the HTTP server.file
- name of the file on the remote side.length
- total size of the data to be transfered.
Use -1 if unknown. The data then will be
transfered in chunks.append
- if true, append data to existing file.
Otherwise, the file will be overwritten.GassException
java.io.IOException
private void init(java.lang.String host, int port, java.lang.String file, long length, boolean append) throws GassException, java.io.IOException
GassException
java.io.IOException
private void sleep(int time)
protected void put(java.lang.String host, java.lang.String file, long length, int waittime) throws java.io.IOException
java.io.IOException
private void checkForReply() throws java.io.IOException
java.io.IOException
private void finish() throws java.io.IOException
java.io.IOException
private void closeSocket()
public void abort()
GlobusOutputStream
abort
in class GlobusOutputStream
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void write(byte[] msg) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] msg, int from, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class GlobusOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException