public class FtpURLConnection extends URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches| Modifier | Constructor and Description |
|---|---|
protected |
FtpURLConnection(URL url)
FtpURLConnection constructor comment.
|
protected |
FtpURLConnection(URL url,
Proxy proxy)
FtpURLConnection constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Establishes the connection to the resource specified by this
URL |
String |
getContentType()
Returns the content type of the resource.
|
InputStream |
getInputStream()
Creates a input stream for writing to this URL Connection.
|
OutputStream |
getOutputStream()
Creates a output stream for writing to this URL Connection.
|
Permission |
getPermission()
Returns the permission object (in this case, SocketPermission) with the
host and the port number as the target name and "resolve, connect" as the
action list.
|
void |
setDoInput(boolean newValue)
Set the flag if this
URLConnection supports input (read). |
void |
setDoOutput(boolean newValue)
Set the flag if this
URLConnection supports output(read). |
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toStringprotected FtpURLConnection(URL url) throws IOException
url - IOExceptionprotected FtpURLConnection(URL url, Proxy proxy) throws IOException
url - proxy - IOExceptionpublic void connect()
throws IOException
URLconnect in class URLConnectionIOException - if an error occurs while connecting to the resource.URLConnection.connected,
IOException,
URLStreamHandlerpublic String getContentType()
getContentType in class URLConnectioncontent-type.public InputStream getInputStream() throws IOException
getInputStream in class URLConnectionIOException - Cannot read from URL or error creating InputStreamURLConnection.getContent(),
getOutputStream(),
InputStream,
IOExceptionpublic Permission getPermission() throws IOException
getPermission in class URLConnectionIOException - thrown when an IO exception occurs during the creation of the
permission object.public OutputStream getOutputStream() throws IOException
getOutputStream in class URLConnectionIOException - when the OutputStream could not be createdURLConnection.getContent(),
getInputStream(),
IOExceptionpublic void setDoInput(boolean newValue)
URLConnection supports input (read).
It cannot be set after the connection is made. FtpURLConnections cannot
support both input and outputsetDoInput in class URLConnectionnewValue - *IllegalAccessError - when this method attempts to change the flag after connectedURLConnection.doInput,
URLConnection.getDoInput(),
IllegalAccessError,
setDoInput(boolean)public void setDoOutput(boolean newValue)
URLConnection supports output(read).
It cannot be set after the connection is made.\ FtpURLConnections cannot
support both input and output.setDoOutput in class URLConnectionnewValue - IllegalAccessError - when this method attempts to change the flag after connectedURLConnection.doOutput,
IllegalAccessError,
setDoOutput(boolean)