Beispiel #1
0
 @Override
 public Representation find(String path) {
   path = path.replace(getServerUrl(), "");
   if (!UrlHelper.hasExtension(path)) path = path + ".xml";
   LocalReference ref = LocalReference.createClapReference(path);
   try {
     return new ClientResource(ref).get();
   } catch (ResourceException e) {
     File file = new File("src/main/webapp" + path);
     if (file.exists() && !file.isDirectory())
       return new FileRepresentation(file, MediaType.TEXT_PLAIN);
     throw new ResourceException(404);
   }
 }