6.8. 查看部署内容
您可以浏览 受管部署中文件的信息,并使用 JBoss EAP 管理界面 读取文件的内容。
6.8.1. 浏览部署中的文件
					使用 browse-content 操作来查看受管部署中的文件和目录。不提供任何参数来返回整个部署结构,或使用 path 参数来提供到特定目录的路径。
				
您也可以从管理控制台浏览部署内容,导航到 Deployments 选项卡,选择部署,然后从下拉菜单中选择 View。
/deployment=helloworld.war:browse-content(path=META-INF/)
/deployment=helloworld.war:browse-content(path=META-INF/)
					这将显示 helloworld.war 部署的 META-INF/ 目录中的文件和目录。
				
					您还可以在 browse-content 操作中指定以下参数。
				
- archive
- 是否仅返回存档文件。
- depth
- 指定要返回的文件的深度。
6.8.2. 读取部署内容
					您可以使用 read-content 操作读取受管部署中文件的内容。不提供任何参数来返回整个部署,或使用 path 参数来提供到特定文件的路径。例如:
				
/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)
/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)这会返回一个文件流,可在 管理 CLI 中显示或 保存到文件系统 中。
6.8.2.1. 显示文件的内容
						使用 attachment display 命令来读取 MANIFEST.MF 文件的内容。
					
attachment display --operation=/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)
attachment display --operation=/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)
						这将显示从 helloworld.war 部署到管理 CLI 的 MANIFEST.MF 文件的内容。
					
6.8.2.2. 保存文件的内容
						使用 attachment save 命令将 MANIFEST.MF 文件的内容保存到文件系统。
					
attachment save --operation=/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF) --file=/path/to/MANIFEST.MF
attachment save --operation=/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF) --file=/path/to/MANIFEST.MF
						这会将 helloworld.war 部署中的 MANIFEST.MF 文件保存到 路径/到 /MANIFEST.MF 的文件系统。如果不使用 the-file 参数指定文件路径,该文件将使用其唯一附加 ID 命名,并保存在管理 CLI 的工作目录中,默认为 EAP_HOME/bin/。