我想要接收文件列表(只是Nexus服务器上的名称)。 这里是我当前的代码:泽西岛接收文件列表
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
client.addFilter(new HTTPBasicAuthFilter(nexusUser, nexusPassword));
WebResource service = client.resource("http://localhost:8081/nexus/content/repositories/linkToRepo
ClientResponse response = service.accept("application/json").get(ClientResponse.class);
String output = response.getEntity(String.class);
但我只是收到HTML代码的服务器。我可以解析HTML,但有没有可能直接接收文件的名称和路径?
这里的HTML代码的一小段收到:
<body>
<h1>Index of /repositories/linkToRepo</h1>
<table cellspacing="10">
<tr>
<th align="left">Name</th>
<th>Last Modified</th>
<th>Size</th>
<th>Description</th>
</tr>
<tr>
<td><a href="../">Parent Directory</a></td>
</tr>
<tr>
<td><a href="http://localhost:8081/nexus/content/repositories/linkToRepo/1.0/">1.0/</a></td>
<td>Wed May 27 14:38:37 CEST 2015</td>
<td align="right">
</td>
<td></td>
</tr>
<tr>
<td><a href="http://localhost:8081/nexus/content/repositories/linktoRepo/maven-metadata.xml">maven-metadata.xml</a></td>
<td>Wed May 27 14:38:37 CEST 2015</td>
<td align="right">
311
</td>
<td></td>
</tr>
亲切的问候, SirSandmann
什么是HTML你收到?任何服务器代码分享? –
如果您在浏览器中请求URL,会发生什么情况? –
嘿,如果我在浏览器中请求HTML,我会得到一个纯HTML,列出目录中列出的文件。 – SirSandmann