Class HTTPOutputStream
java.lang.Object
java.io.OutputStream
org.globus.io.streams.GlobusOutputStream
org.globus.io.streams.HTTPOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
- Direct Known Subclasses:
GassOutputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate static final byte[]private static final intprotected InputStreamprivate static org.apache.commons.logging.Logprotected OutputStreamprotected longprotected Socket -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrivate constructor used by subclasses.HTTPOutputStream(String host, int port, String file, long length, boolean append) Opens HTTP output stream (unsecure) -
Method Summary
Methods inherited from class OutputStream
nullOutputStream
-
Field Details
-
logger
private static org.apache.commons.logging.Log logger -
CRLF
private static final byte[] CRLF -
DEFAULT_TIME
private static final int DEFAULT_TIME- See Also:
-
output
-
in
-
socket
-
size
protected long size -
append
protected boolean append
-
-
Constructor Details
-
HTTPOutputStream
protected HTTPOutputStream()Private constructor used by subclasses. -
HTTPOutputStream
public HTTPOutputStream(String host, int port, String file, long length, boolean append) throws GassException, IOException Opens HTTP output stream (unsecure)- Parameters:
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.- Throws:
GassExceptionIOException
-
-
Method Details
-
init
private void init(String host, int port, String file, long length, boolean append) throws GassException, IOException - Throws:
GassExceptionIOException
-
sleep
private void sleep(int time) -
put
- Throws:
IOException
-
checkForReply
- Throws:
IOException
-
finish
- Throws:
IOException
-
closeSocket
private void closeSocket() -
abort
public void abort()Description copied from class:GlobusOutputStreamAborts transfer. Usually makes sure to release all resources (sockets, file descriptors)
Does nothing by default.- Overrides:
abortin classGlobusOutputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classGlobusOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-