öffnen Sie eine Datei in einem tomcat webapplication

ich will eine Datei öffnen und wieder in seine Inhalte. Obwohl es im gleichen Verzeichnis wie die Klasse, die will, um die Datei zu öffnen, wird die Datei nicht gefunden werden kann. Wäre cool wenn Ihr mir helfen könntet das problem zu lösen.

Hier ist der code:

@GET @Produces("text/html") @Path("/{partNO}/") @Consumes("text/html")
public String getPartNoResponseHTML(@PathParam("partNO") String parID) throws WebApplicationException {
PartNoTemplate partNo = getPartNoResponse(parID);

String result = "";

try {
  result = readFile(PART_NO_TEMPLATE_FILE);
} catch (FileNotFoundException e) {
  e.printStackTrace(System.out);
  return e.getMessage() + e.toString();
  //throw new WebApplicationException(Response.Status.NOT_FOUND);
} finally {
  result = result.replace("{partNO}", parID);
  result = result.replace("{inputFormat}", partNo.getFormat().toString());
}

return result;
}

Ich denke, es kann nicht die Datei finden, denn Sie läuft auf tomcat. Ich bin auch mit Jersey und JAX-RS. Danke für Eure Hilfe,

Maxi

InformationsquelleAutor Maxiking1011 | 2013-01-31
Schreibe einen Kommentar