public class NetPlugin
extends java.lang.Object
网络资源操作插件
比如,FTP 服务器资源上传和下载
Plugin of net resources
Such as, FTP resources
Email: fishinlove@163.com
created by 2019/04/02 16:16:15
| 构造器和说明 |
|---|
NetPlugin() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
uploadBinaryToServer(LoginInfo loginInfo,
java.lang.String remoteDirection,
java.lang.String remoteFileName,
java.io.InputStream inputStream)
上传一个二进制文件到 FTP 服务器
注意:
controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice:
controlEncoding is used to net transport, default value is in TuzConfig
|
static boolean |
uploadBinaryToServer(java.lang.String remoteDirection,
java.lang.String remoteFileName,
java.io.InputStream inputStream)
上传一个二进制文件到 FTP 服务器
注意:
controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice:
controlEncoding is used to net transport, default value is in TuzConfig
|
static boolean |
uploadTextToServer(LoginInfo loginInfo,
java.lang.String remoteDirection,
java.lang.String remoteFileName,
java.io.InputStream inputStream)
上传一个文本文件到 FTP 服务器
注意:
由于文本文件可能有编码问题,这里使用默认配置中的编码来解码,具体请看下面的 @see
controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice:
This method use default encoding to decode this text file,
controlEncoding is used to net transport, default value is in TuzConfig
|
static boolean |
uploadTextToServer(LoginInfo loginInfo,
java.lang.String remoteDirection,
java.lang.String remoteFileName,
java.io.InputStream inputStream,
java.nio.charset.Charset charset)
上传一个文本文件到 FTP 服务器
注意:
由于文本文件可能有编码问题,所以这里多一个文本字符集的参数,
controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice:
You should appointed the encoding of text file to avoid encoding problems.
|
static boolean |
uploadToServer(FTPUploadFile file)
上传一个文件到 FTP 服务器
注意:
这个参数包含很多要被上传文件的属性以及 FTP 服务器的属性,
controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice:
This argument "file" has many attributes about the file
to be uploaded and info of FTP server.
|
public static boolean uploadToServer(FTPUploadFile file) throws java.io.IOException
上传一个文件到 FTP 服务器
注意: 这个参数包含很多要被上传文件的属性以及 FTP 服务器的属性, controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice: This argument "file" has many attributes about the file to be uploaded and info of FTP server. controlEncoding is used to net transport, default value is in TuzConfig
file - 要被上传的文件,这个参数包含很多要被上传文件的属性以及 FTP 服务器的属性
The file to be uploaded, This argument "file" has many attributes about the file to be uploaded and info of FTP server
true 上传成功,false 上传不成功
true if successful, false if not
java.io.IOException - 上传遇到问题就会抛出这个异常
If occur some problems when uploading
TuzConfig.getFtpControlEncoding(),
FTP.setControlEncoding(String)public static boolean uploadBinaryToServer(LoginInfo loginInfo, java.lang.String remoteDirection, java.lang.String remoteFileName, java.io.InputStream inputStream) throws java.io.IOException
上传一个二进制文件到 FTP 服务器
注意: controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice: controlEncoding is used to net transport, default value is in TuzConfig
loginInfo - 登录 FTP 服务器的用户信息,比如用户名和密码
User who login FTP server
remoteDirection - 文件保存在 FTP 服务器的那个文件
The direction where the file will be saved
remoteFileName - 文件保存的名字
The name of file in the FTP server
inputStream - 文件输入流
File inputStream
true 上传成功,false 上传不成功
true if successful, false if not
java.io.IOException - 上传遇到问题就会抛出这个异常
If occur some problems when uploading
public static boolean uploadBinaryToServer(java.lang.String remoteDirection,
java.lang.String remoteFileName,
java.io.InputStream inputStream)
throws java.io.IOException
上传一个二进制文件到 FTP 服务器
注意: controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice: controlEncoding is used to net transport, default value is in TuzConfig
remoteDirection - 文件保存在 FTP 服务器的那个文件
The direction where the file will be saved
remoteFileName - 文件保存的名字
The name of file in the FTP server
inputStream - 文件输入流
File inputStream
true 上传成功,false 上传不成功
true if successful, false if not
java.io.IOException - 上传遇到问题就会抛出这个异常
If occur some problems when uploading
public static boolean uploadTextToServer(LoginInfo loginInfo, java.lang.String remoteDirection, java.lang.String remoteFileName, java.io.InputStream inputStream, java.nio.charset.Charset charset) throws java.io.IOException
上传一个文本文件到 FTP 服务器
注意: 由于文本文件可能有编码问题,所以这里多一个文本字符集的参数, controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice: You should appointed the encoding of text file to avoid encoding problems. controlEncoding is used to net transport, default value is in TuzConfig
loginInfo - 登录 FTP 服务器的用户信息,比如用户名和密码
User who login FTP server
remoteDirection - 文件保存在 FTP 服务器的那个文件
The direction where the file will be saved
remoteFileName - 文件保存的名字
The name of file in the FTP server
inputStream - 文件输入流
File inputStream
charset - 文本文件的字符集编码
The encoding of text file
true 上传成功,false 上传不成功
true if successful, false if not
java.io.IOException - 上传遇到问题就会抛出这个异常
If occur some problems when uploading
public static boolean uploadTextToServer(LoginInfo loginInfo, java.lang.String remoteDirection, java.lang.String remoteFileName, java.io.InputStream inputStream) throws java.io.IOException
上传一个文本文件到 FTP 服务器
注意: 由于文本文件可能有编码问题,这里使用默认配置中的编码来解码,具体请看下面的 @see controlEncoding 是网络通信使用的编码,是内部赋值的,外界不需要知道,它的默认值是在 TuzConfig 中
Upload a file to FTP server
Notice: This method use default encoding to decode this text file, controlEncoding is used to net transport, default value is in TuzConfig
loginInfo - 登录 FTP 服务器的用户信息,比如用户名和密码
User who login FTP server
remoteDirection - 文件保存在 FTP 服务器的那个文件
The direction where the file will be saved
remoteFileName - 文件保存的名字
The name of file in the FTP server
inputStream - 文件输入流
File inputStream
true 上传成功,false 上传不成功
true if successful, false if not
java.io.IOException - 上传遇到问题就会抛出这个异常
If occur some problems when uploading
FTPUploadFile.getCharset()Copyright © 2019. All Rights Reserved.