Package org.globus.io.streams
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 boolean
private static final byte[]
private static final int
protected InputStream
private static org.apache.commons.logging.Log
protected OutputStream
protected long
protected Socket
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Private 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 java.io.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:
GassException
IOException
-
-
Method Details
-
init
private void init(String host, int port, String file, long length, boolean append) throws GassException, IOException - Throws:
GassException
IOException
-
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:GlobusOutputStream
Aborts transfer. Usually makes sure to release all resources (sockets, file descriptors)
Does nothing by default.- Overrides:
abort
in classGlobusOutputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classGlobusOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-