|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bss.esb.util.NetUtil
Utility class that offers methods for performing the network operations such as:
1. Http POST/GET/PUT operations
2. Obtaining a client FTPClient
for performing FTP operation.
FTPClient
,
HttpClient
Constructor Summary | |
NetUtil()
|
Method Summary | |
static void |
closeFtpSession(org.apache.commons.net.ftp.FTPClient ftp)
Closes the FTPClient session and logs out from FTP server. |
static byte[] |
doHttpGet(java.lang.String strURL,
java.lang.String user,
java.lang.String password)
Does an HTTP GET from the supplied URL. |
static int |
doHttpPost(java.lang.String strURL,
java.io.InputStream input,
java.lang.String contentType,
java.lang.String user,
java.lang.String password)
Does an HTTP POST of the resource available via the supplied InputStream. |
static int |
doHttpPut(java.lang.String strURL,
java.io.InputStream input,
java.lang.String contentType,
java.lang.String user,
java.lang.String password)
Does an HTTP PUT of the resource available via the supplied InputStream. |
static org.apache.commons.net.ftp.FTPClient |
getFtpClient(java.lang.String host,
int port,
java.lang.String user,
java.lang.String passwd)
Gets the initialized FTPClient instance. |
static org.apache.commons.net.ftp.FTPClient |
getFtpClient(java.lang.String host,
java.lang.String user,
java.lang.String passwd)
Gets the initialized FTPClient instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NetUtil()
Method Detail |
public static int doHttpPost(java.lang.String strURL, java.io.InputStream input, java.lang.String contentType, java.lang.String user, java.lang.String password) throws java.lang.Exception
strURL
- URL for the request targetinput
- InputStream for the resource to be POSTedcontentType
- user
- User name for authenticating to target hostpassword
- Password for authenticating to target host
java.lang.Exception
public static int doHttpPut(java.lang.String strURL, java.io.InputStream input, java.lang.String contentType, java.lang.String user, java.lang.String password) throws java.lang.Exception
strURL
- URL for the request targetinput
- InputStream for the resource to be PUTcontentType
- user
- User name for authenticating to target hostpassword
- Password for authenticating to target host
java.lang.Exception
public static byte[] doHttpGet(java.lang.String strURL, java.lang.String user, java.lang.String password) throws java.lang.Exception
strURL
- URL for the request targetuser
- User name for authenticating to target hostpassword
- Password for authenticating to target host
java.lang.Exception
public static org.apache.commons.net.ftp.FTPClient getFtpClient(java.lang.String host, int port, java.lang.String user, java.lang.String passwd) throws java.lang.Exception
FTPClient
instance.
It connects to the default FTP port.
host
- - FTP hostport
- FTP port#user
- - FTP userpasswd
- - FTP password
java.lang.Exception
public static org.apache.commons.net.ftp.FTPClient getFtpClient(java.lang.String host, java.lang.String user, java.lang.String passwd) throws java.lang.Exception
FTPClient
instance.
It connects to the default FTP port (21).
host
- - FTP hostuser
- - FTP userpasswd
- - FTP password
java.lang.Exception
public static void closeFtpSession(org.apache.commons.net.ftp.FTPClient ftp)
FTPClient
session and logs out from FTP server.
ftp
- - The FTPClient.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |