美丽燕郊我的家歌曲:Mule 3.x 中对 Ftp 协议的支持
来源:百度文库 编辑:偶看新闻 时间:2024/03/29 09:12:42
1. 前言
一直都听说 Mule 对 Ftp 和 Http 协议的支持很好,于是就关注了一下。
Mule 通过一系列的配置文件的配置就可以完成对 Ftp 服务器的下载和上传 ,这个还是很神奇的。
但是可惜的是, Mule 本身并不支持 FtpS 协议,只支持 SFTP ,这样对于工业级的使用上,未免有点不方便 。
2. Mule 3.x 的基本知识
Mule 是一个开源的 ESB 软件,基本概念如下:
http://tech.ddvip.com/2010-05/1274838569154227.html
Mule 3.X 中对 Ftp 的支持是通过 < ftp:connector> 等标签实现的,具体的官方信息如下:
http://www.mulesoft.org/documentation/display/MULE3USER/FTP+Transport
在 Mule 3.x 中,运行 config.xml 的方法如下:
a. 在 app 目录下新建一个目录,比如 test-ftp
b. 将写好的 config.xml 拷贝到 test-ftp 下,并且取名为 mule-config.xml
c. 在 bin 目录下,运行 CMD 如下
Mule –app test-ftp
3. Mule 3.x 中 ftp 支持的方法
a. 从 ftp 服务器上下载文件的方法
xml version = "1.0" encoding = "UTF-8" ?>
< mule xmlns = "http://www.mulesoft.org/schema/mule/core"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring = "http://www.springframework.org/schema/beans"
xmlns:http = "http://www.mulesoft.org/schema/mule/http"
xmlns:vm = "http://www.mulesoft.org/schema/mule/vm"
xmlns:ftp = "http://www.mulesoft.org/schema/mule/ftp"
xmlns:file = "http://www.mulesoft.org/schema/mule/file"
xsi:schemaLocation = "
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.0/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.0/mule-file.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.0/mule-ftp.xsd" >
< ftp:connector name = "ftpConnector" binary = "true"
validateConnections = "true" />
< model name = "ftp-model" >
< service name = "ftp-reader" >
< inbound >
< ftp:inbound-endpoint user = "zhany" binary = "true" path = ""
password = "zhany" host = "192.168.120.33" port = "21"
pollingFrequency = "10000" connector-ref = "ftpConnector"
>
< file:filename-wildcard-filter
pattern = "*.xml" />
ftp:inbound-endpoint >
inbound >
< outbound >
< pass-through-router >
< file:outbound-endpoint path = "/e:/out" outputPattern = "[header:originalFilename]" />
pass-through-router >
outbound >
service >
model >
mule >
b. 上传文件到 ftp 服务器上的办法
xml version = "1.0" encoding = "UTF-8" ?>
< mule xmlns = "http://www.mulesoft.org/schema/mule/core"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring = "http://www.springframework.org/schema/beans"
xmlns:http = "http://www.mulesoft.org/schema/mule/http"
xmlns:vm = "http://www.mulesoft.org/schema/mule/vm"
xmlns:ftp = "http://www.mulesoft.org/schema/mule/ftp"
xmlns:file = "http://www.mulesoft.org/schema/mule/file"
xsi:schemaLocation = "
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.0/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.0/mule-file.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.0/mule-ftp.xsd" >
< file:connector name = "fileConnector" pollingFrequency = "6000" />
< ftp:connector name = "ftpConnector" />
< model name = "model" >
< service name = "service" >
< inbound >
< file:inbound-endpoint path = "/e:/tmp"
connector-ref = "fileConnector" >
file:inbound-endpoint >
inbound >
< outbound >
< pass-through-router >
< ftp:outbound-endpoint host = "192.168.120.33"
port = "21" user = "zhany" password = "zhany" path = "" connector-ref = "ftpConnector" />
pass-through-router >
outbound >
service >
model >
mule >
一直都听说 Mule 对 Ftp 和 Http 协议的支持很好,于是就关注了一下。
Mule 通过一系列的配置文件的配置就可以完成对 Ftp 服务器的下载和上传 ,这个还是很神奇的。
但是可惜的是, Mule 本身并不支持 FtpS 协议,只支持 SFTP ,这样对于工业级的使用上,未免有点不方便 。
2. Mule 3.x 的基本知识
Mule 是一个开源的 ESB 软件,基本概念如下:
http://tech.ddvip.com/2010-05/1274838569154227.html
Mule 3.X 中对 Ftp 的支持是通过 < ftp:connector> 等标签实现的,具体的官方信息如下:
http://www.mulesoft.org/documentation/display/MULE3USER/FTP+Transport
在 Mule 3.x 中,运行 config.xml 的方法如下:
a. 在 app 目录下新建一个目录,比如 test-ftp
b. 将写好的 config.xml 拷贝到 test-ftp 下,并且取名为 mule-config.xml
c. 在 bin 目录下,运行 CMD 如下
Mule –app test-ftp
3. Mule 3.x 中 ftp 支持的方法
a. 从 ftp 服务器上下载文件的方法
xml version = "1.0" encoding = "UTF-8" ?>
< mule xmlns = "http://www.mulesoft.org/schema/mule/core"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring = "http://www.springframework.org/schema/beans"
xmlns:http = "http://www.mulesoft.org/schema/mule/http"
xmlns:vm = "http://www.mulesoft.org/schema/mule/vm"
xmlns:ftp = "http://www.mulesoft.org/schema/mule/ftp"
xmlns:file = "http://www.mulesoft.org/schema/mule/file"
xsi:schemaLocation = "
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.0/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.0/mule-file.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.0/mule-ftp.xsd" >
< ftp:connector name = "ftpConnector" binary = "true"
validateConnections = "true" />
< model name = "ftp-model" >
< service name = "ftp-reader" >
< inbound >
< ftp:inbound-endpoint user = "zhany" binary = "true" path = ""
password = "zhany" host = "192.168.120.33" port = "21"
pollingFrequency = "10000" connector-ref = "ftpConnector"
>
< file:filename-wildcard-filter
pattern = "*.xml" />
ftp:inbound-endpoint >
inbound >
< outbound >
< pass-through-router >
< file:outbound-endpoint path = "/e:/out" outputPattern = "[header:originalFilename]" />
pass-through-router >
outbound >
service >
model >
mule >
b. 上传文件到 ftp 服务器上的办法
xml version = "1.0" encoding = "UTF-8" ?>
< mule xmlns = "http://www.mulesoft.org/schema/mule/core"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring = "http://www.springframework.org/schema/beans"
xmlns:http = "http://www.mulesoft.org/schema/mule/http"
xmlns:vm = "http://www.mulesoft.org/schema/mule/vm"
xmlns:ftp = "http://www.mulesoft.org/schema/mule/ftp"
xmlns:file = "http://www.mulesoft.org/schema/mule/file"
xsi:schemaLocation = "
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.0/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.0/mule-file.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.0/mule-ftp.xsd" >
< file:connector name = "fileConnector" pollingFrequency = "6000" />
< ftp:connector name = "ftpConnector" />
< model name = "model" >
< service name = "service" >
< inbound >
< file:inbound-endpoint path = "/e:/tmp"
connector-ref = "fileConnector" >
file:inbound-endpoint >
inbound >
< outbound >
< pass-through-router >
< ftp:outbound-endpoint host = "192.168.120.33"
port = "21" user = "zhany" password = "zhany" path = "" connector-ref = "ftpConnector" />
pass-through-router >
outbound >
service >
model >
mule >
BT和E-MULE下载中上传会对硬盘有怎样的伤害
关于FTP协议的问题!
结合FTP协议执行过程的分析,总结自己对网络体系结构中各层协议之间的关系,以及对网络协议的理解
如何把e-mule中曾经搜索的内容删掉?
网络地址中除了我们常用的HTTP,FTP,HTTPS,RSTP还有没有其他的协议?
smtp协议 pcp协议 ftp协议 telnet协议的解释分别是什么?
FTP协议与HTTP协议的详细报文格式是什么
域名服务使用的是否FTP协议?
FTP协议的中文含义是
FTP协议的中文含义是
滑动窗口协议中对窗口大小的理解?
FTP文件传输协议,TCP/IP********协议等等中的协议,通俗的说究竟是什么意思?
在地址栏中输入ftp://student.net.cn,其所采用的网络协议是
都说用BT伤硬盘是不是真的?改用E Mule对硬盘伤害大吗?
如何安装ftp协议
关于e-mule的用法
对赌协议的英文名称?
在e-Mule下载的影片中怎样把中文字幕打到影片上去?谢谢!
FTP是TCP/IP协议的一部分对吗
传输协议FTP的工作原理和使用步骤
传输协议FTP的工作原理和使用步骤是什么
ftp 协议的文件 最好用什么下载工具下载?
为什么在http协议的网页上还有ftp协议的下载地址?
http https ftp mms rtsp等以**://的协议属于什么样的协议?