
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Tags: latest
Maintained By: Philip M. Trenwith Date 18 November 2018
This container contains a Java application that runs a RESTful API on port 8080. The API is designed to list the files in a specified directory and return the filenames, sizes and file attributes. The Java application makes use of Maven to manage the dependencies.
============= BUILDING & RUNNING ============= To build and run this application the user can clone the repository using git: git clone https://***/philiptrenwith/listservice.git
and then run the script provided. On Linux: chmod -x buildimage.sh sudo ./buildimage.sh
On Windows: Double click buildimage.cmd (Or open the command line and navigate to the directory and then run the script)
These scripts will build the container and run it. To consume the rest server the user can make calls to the rest service using CURL and the URL's provided below.
================= REST CALLS =================
The calls that is accepted by the REST API are:
http://
The path parameter specifies the path where the files of interest are. When listing the files at a given path, the user has to specify the number of files that has to be returned by the rest call, using the size parameter. The user can also specify the offset which indicates which file in the list should be the first file in the list.
The files at a given path are listed making use of a File Stream. Once the Stream is opened an iterator is retrieved that is used to read the files in the directory using the next() method. If the user specifies an offset of -1, the iterator remains open and with every subsequent call to the REST API to list a subset of files in the directory the next subset of files is returned. If a user specifies an offset != -1 the filestream is closed and reopened placing the iterator at zero. The iterator is then moved the position specified by the offset and n-number of files are read and returned where n indicates the value of the size parameter.
When the iterator reaches the end of the list and there are no more files to return the stream is closed automatically. The Stream will also be closed automatically after a period of inactivity, meaning the iterator has not moved in a set amount of time. The default time of inactivity is 10-minutes. The period of inactivity can be configured in the config.yaml file. The user can also close the file stream manually with a rest call to:
http://
http://
http://
=============== CONFIGURATION ================ Some values are configurable and the configuration is provided in a YAML configuration file: config.yaml The attributes that can be configured is provided below with the default values.
host_address: 0.0.0.0 -> address to ***d to port_number: 8080 -> port to ***d to stream_timeout_period_min: 10 -> time to keep the Stream open after last access before closing rest_connect_timeout_ms: 30000 -> time to wait to connect to rest service before timeout. rest_read_timeout_ms: 60000 -> time to wait for rest response (reading) before timeout.
================= UNIT TESTS ================= Some unit tests has been added to test various parts of the application and ensure that everything works as expected. A "functional" test has also been written at org.trenwith.main.rest.client.cListDirectoryApiClientTest.java, this class test the application as a whole. First the REST service is started and the calling thread waits for the service to come online and ***d to the default port 8080. Then a call is made to generate some random files and then a call is made to list the files. The call to generate files is not blocking, therefore the call made to list files may not return all the files that is generated because the generation thread may still be in progress. However, for this functional test it is only important to ensure that the REST server starts, files can be generated and the call to list files at a given path works successfully.
================= LOGGING ==================== Logging has been added to the application using the SLF4J logger. The logger has also been configured using logback to write the log files to the standard syslog. The logger can be configured using the logback.xml file.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务