Package dk.brics.jwig

Examples of dk.brics.jwig.JWIGException


    }

    @Override
    void makeURL(StringBuilder b, Map<String,String[]> argmap) {
      if (argmap == null)
        throw new JWIGException("Parameters expected");
      String[] values = argmap.get(param);
      if (values == null)
        throw new JWIGException("Parameter expected: " + param);
      if (values.length != 1)
        throw new JWIGException("One parameter expected: " + param);
      b.append(URLEncoding.encode(values[0]));
      argmap.remove(param);
    }
View Full Code Here


                }
            }
        } catch (NoSuchMethodException e) {
            //
        } catch (Exception e) {
            throw new JWIGException(e);
        }
        if (!accessMethodResult) {
            return false;
        }
        //If the access method returns true, make sure the constraints from the @AccessScope annotations are also satisfied
        boolean accessScopeAnnotationResult = true;
        boolean hasAccessScopeAnnotation = false;
        for (Method m : querier.getClass(persistable).getMethods()) {
            if (m.getAnnotation(AccessScope.class) != null) {
                if (m.getParameterTypes().length == 0 && Persistable.class.isAssignableFrom(m.getReturnType())) {
                    m.setAccessible(true);
                    hasAccessScopeAnnotation = true;
                    try {
                        accessScopeAnnotationResult &= hasAccess((Persistable) m.invoke(persistable), depth + 1);
                    } catch (Exception e) {
                        throw new JWIGException(e);
                    }
                }
            }
        }
        if (!hasAccessScopeAnnotation && !hasAccessMethod) return false;
View Full Code Here

          response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
          response.setHeader("Connection", "close");
          try {
          response.getOutputStream().close();
        } catch (IOException e) {
          throw new JWIGException(e);
        }
        }
      }
      connection2listener.clear();
      fragment2listeners.clear();
View Full Code Here

    public static String encode(String s) {
        try {
            byte[] rawBytes = encrypter.doFinal(s.getBytes());
            return String.valueOf(Base64.encode(rawBytes));
        } catch (Exception e) {
            throw new JWIGException(e);
        }
    }
View Full Code Here

    public static String decode(String s) {
        try {
            byte[] base64Decoded = Base64.decode(s);
            return new String(decrypter.doFinal(base64Decoded));
        } catch (Exception e) {
            throw new JWIGException(e);
        }
    }
View Full Code Here

            }
            for (Map.Entry<Object, Object> e : ps.entrySet()) {
                configuration.put((String) e.getKey(), e.getValue());
            }
        } catch (IOException e) {
            throw new JWIGException("unable to read jwig.properties", e);
        }
    }
View Full Code Here

        try {
            Class<?> declaringClass = method.getDeclaringClass();
            JavaClass javaClass = Repository.lookupClass(declaringClass);
            return javaClass.getMethod(method);
        } catch (ClassNotFoundException e) {
            throw new JWIGException(e);
        }
    }
View Full Code Here

                        throw new IllegalArgumentException("Error in method " +method.getDeclaringClass() + "." + method.getName() + ". Generic parameters not supported");
                    }
                    String javaClassName = Repository.lookupClass(rawClassName).getClassName();
                    return Class.forName(javaClassName);
                } catch (ClassNotFoundException e) {
                    throw new JWIGException(e);
                }
            }
        }
        return null;
    }
View Full Code Here

   */
  public static String encode(String s) {
    try {
      return URLEncoder.encode(s, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new JWIGException(e);
    }
  }
View Full Code Here

   */
  public static String decode(String url) {
    try {
      return URLDecoder.decode(url, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new JWIGException(e);
    }
  }
View Full Code Here

TOP

Related Classes of dk.brics.jwig.JWIGException

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.