Package org.jibeframework.core

Examples of org.jibeframework.core.JibeRuntimeException


    try {
      File file = ResourceUtils.getFile(Application.getClasspathPrefix() + path);
      lastModified = file.lastModified();
      return new FileInputStream(file);
    } catch (IOException e) {
      throw new JibeRuntimeException(e);
    }
  }
View Full Code Here


    try {
      File file = ResourceUtils.getFile(Application.getClasspathPrefix() + path);
      lastModified = file.lastModified();
      return FileUtils.readFileToString(file, "UTF-8");
    } catch (IOException e) {
      throw new JibeRuntimeException(e);
    }
  }
View Full Code Here

  public boolean isModified() {
    try {
      File file = ResourceUtils.getFile(Application.getClasspathPrefix() + path);
      return this.lastModified != file.lastModified();
    } catch (IOException e) {
      throw new JibeRuntimeException(e);
    }
  }
View Full Code Here

    if (StringUtils.isNotEmpty(source)) {
      SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
      try {
        return df.parse(source);
      } catch (ParseException e) {
        throw new JibeRuntimeException(e);
      }
    }
    return null;
  }
View Full Code Here

      javaScriptsBuffer.append(System.getProperty("line.separator"));
      try {
        File file = ResourceUtils.getFile(Application.getClasspathPrefix() + script);
        javaScriptsBuffer.append(FileUtils.readFileToString(file, "UTF-8"));
      } catch (IOException e) {
        throw new JibeRuntimeException("Can not read javascript file:" + script);
      }
    }
    return javaScriptsBuffer.toString();

  }
View Full Code Here

        File file = ResourceUtils.getFile(Application.getClasspathPrefix() + cssPath);
        if (file.exists()) {
          fileNames = file.listFiles();
        }
      } catch (IOException e) {
        throw new JibeRuntimeException("CSS Folder is not readable", e);
      }
      if (fileNames != null) {
        for (File f : fileNames) {
          cssFiles.add(String.format("%1$s/%2$s", Application.getClasspathPrefix() + cssPath, f.getName()));
        }
View Full Code Here

      Properties p = new Properties();
      for (String clientBundle : clientBundles) {
        try {
          p.putAll(getMessagesFromBundle(Application.getClasspathPrefix() + clientBundle));
        } catch (IOException e) {
          throw new JibeRuntimeException("Message bundles could not be loaded", e);
        }
      }
      for (Object key : p.keySet()) {
        o.put((String) key, p.getProperty((String) key));
      }
View Full Code Here

    for (String bundle : serverBundles) {
      Properties p = null;
      try {
        p = getMessagesFromBundle(Application.getClasspathPrefix() + bundle);
      } catch (IOException e) {
        throw new JibeRuntimeException("Could not load message bundles", e);
      }
      for (String msg : p.stringPropertyNames()) {
        messages.put(msg, p.getProperty(msg));
      }
    }
View Full Code Here

      if (methods[i].getName().equals(methodName)) {
        candidates.add(methods[i]);
      }
    }
    if (candidates.isEmpty()) {
      throw new JibeRuntimeException("Method " + methodId + " could not be found");
    }
    if (candidates.size() == 1) {
      Method method = candidates.get(0);
      return ReflectionUtils.invokeMethod(method, bean, args);
    } else {
      throw new JibeRuntimeException("Overloaded methods are not supported yet");
    }
  }
View Full Code Here

          Object[] resolvedArguments = argumentsResolver.resolveArguments(methods[i], args);
          candidates.add(new MethodHolder(methodId, bean, methods[i], resolvedArguments));
        }
      }
      if (candidates.isEmpty()) {
        throw new JibeRuntimeException("Method " + methodId + " could not be found");
      }
      Double bestGuess = null;
      MethodHolder bestCandidate = null;
      for (MethodHolder candidate : candidates) {
        double guess = candidate.getQuality();
        if (bestGuess == null || guess > bestGuess) {
          bestGuess = guess;
          bestCandidate = candidate;
        }
      }
      return bestCandidate;
    }
    throw new JibeRuntimeException(
        "It is only possible to invoke methods on classes annotated with @Controller  or @UIComponent annotations: "
            + methodId);
  }
View Full Code Here

TOP

Related Classes of org.jibeframework.core.JibeRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.