你在这里: 参考手册 > FME服务器Web服务 > 通知服务 > 出版商 > Directory Watch Publisher

Directory Watch Publisher

目录观看发布商监视活动的活动资源管理目录或其他位置,并将关于该活动的消息发布到FME服务器主题。活动可以包括添加,更改和删除文件和文件夹。

配置发布者

  1. 在FME服务器中Web User Interface, 选择通知>出版物,然后点击New
  2. 提供出版物的名称
  3. 协议:选择目录手表。
  4. Specify the话题您希望发布到使用下拉选择器。要创建主题并立即使用它,请单击+

  5. 要观看目录: To watch a资源directory, click the ellipsis (......), and select a directory to watch. To watch another directory, enter a local file system or network (UNC) path directly in the textbox.
  6. 笔记:运行FME服务器核心的用户帐户服务必须在任何未被管理为FME服务器资源的目录中读/写(Windows)或读取(Linux)权限。看here有关将目录添加为资源的信息。

  7. 观看子目录: To watch activity in the selected directory and all subdirectories, specify是的。To watch activity only in the selected directory and not in its subdirectories, specifyNo。This setting also applies to directories that are added into the watched directory. IfNo,在添加目录中的文件中未生成单独的通知。
  8. 收到文件夹通知: 如果是的,Publisher监控两个文件和文件夹的活动。如果No,Publisher仅监视文件的活动。
  9. 过滤器:默认情况下,发布者会监视指定目录上的所有操作,包括添加(创建),更改(修改)和删除(删除)文件(如果适用)和文件夹)。要仅将发布者应用于其中一个或两个操作,请单击操作旁边的“X”,您不希望监视以删除它。要在删除它后添加一个操作,请单击Dropbox并选择它。
  10. 笔记:Events trigger based on changes in file name and size. No notification is triggered if a change to an existing file does not change file size, or if a file is overwritten with one of the same size. If a file is overwritten with one of a different size, a MODIFY event is triggered.

  11. 民意调查间隔:通常,在几分钟内,调查显示指定的Directory to Watch for activity.
  12. 点击OK

示例通知模式

要从目录监视发布者解析传入的JSON消息,请使用Directory Watch ReaderFME Workbench工作区中的自定义格式。有关更多信息并下载读者,请访问FME商店fmestore.safe.com/

When a file is deleted

{

“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,

“dirwatch_publisher_content”:“entry_delete c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,

“dirwatch_publisher_action”:“删除”,

"fns_type": "dirwatch_publisher"

}

更改文件时(例如,添加内容)

{

“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,

“dirwatch_publisher_content”:“entry_modify c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,

“dirwatch_publisher_action”:“修改”,

"fns_type": "dirwatch_publisher"

}

添加文件时

{

“dirwatch_publisher_path”:“c:\\ apps \\ fmeserver \\ temp \\ sample_file.txt”,

"dirwatch_publisher_content": "ENTRY_CREATE C:\\apps\\FMEServer\\Temp\\sample_file.txt",

"dirwatch_publisher_action": "CREATE",

"fns_type": "dirwatch_publisher"

}