Example #1
0
 /**
  * 曲キーを元に曲の動画を示すオブジェクトを1件返す
  *
  * @param paramKey
  * @return
  */
 public final SenseParamMr fetchSingle(final String paramKey, final String subKey) {
   if (StringUtil.isBlank(paramKey) || StringUtil.isBlank(subKey)) {
     return null;
   }
   return select()
       .where(new SimpleWhere().eq("paramKey", paramKey).eq("subKey", subKey))
       .getSingleResult();
 }
Example #2
0
 /**
  * キーを指定して削除する。
  *
  * @param songKey
  * @return
  */
 public final int remove(final String paramKey, final String subKey) {
   if (StringUtil.isBlank(paramKey) || StringUtil.isBlank(subKey)) {
     return 0;
   }
   SenseParamMr chk = fetchSingle(paramKey, subKey);
   if (chk == null) {
     return 0;
   } else {
     return delete(chk);
   }
 }
  public void init(FilterConfig config) throws ServletException {
    String access = config.getInitParameter("jspDirectAccess");
    if (StringUtil.isNotBlank(access)) {
      jspDirectAccess = Boolean.valueOf(access);
    }

    String routesPath = config.getInitParameter("routes");
    if (StringUtil.isNotEmpty(routesPath)) {
      String realRoutesPath = config.getServletContext().getRealPath(routesPath);
      if (realRoutesPath != null) {
        routes = new File(realRoutesPath);
      }
      InputStream routesStream = config.getServletContext().getResourceAsStream(routesPath);
      try {
        Routes.load(routesStream);
      } finally {
        InputStreamUtil.close(routesStream);
      }
      lastLoaded = System.currentTimeMillis();
    }

    String interval = config.getInitParameter("checkInterval");
    if (StringUtil.isNotEmpty(interval)) {
      checkInterval = LongConversionUtil.toLong(interval);
    }
    if (checkInterval == null || checkInterval < 0) {
      checkInterval = -1L;
    }

    String contextSensitiveParam = config.getInitParameter("contextSensitive");
    if (StringUtil.isNotBlank(contextSensitiveParam)) {
      contextSensitive = Boolean.valueOf(contextSensitiveParam);
    }
    if (contextSensitive) {
      try {
        Method getContextPath = ReflectionUtil.getMethod(ServletContext.class, "getContextPath");
        UrlRewriter.contextPath =
            (String) MethodUtil.invoke(getContextPath, config.getServletContext(), null);
      } catch (NoSuchMethodRuntimeException e) {
        UrlRewriter.contextPath = config.getServletContext().getServletContextName();
      }
    }
    requestUriHeader = config.getInitParameter("requestUriHeader");

    String fallThroughParam = config.getInitParameter("fallThrough");
    if (StringUtil.isNotBlank(fallThroughParam)) {
      fallThrough = Boolean.valueOf(fallThroughParam);
    }
  }
 /**
  * 一対多の関連を処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param field フィールド
  * @param entityMeta エンティティメタデータ
  * @param oneToMany 一対多関連
  */
 protected void doOneToMany(
     PropertyMeta propertyMeta, Field field, EntityMeta entityMeta, OneToMany oneToMany) {
   propertyMeta.setRelationshipType(RelationshipType.ONE_TO_MANY);
   if (!List.class.isAssignableFrom(field.getType())) {
     throw new OneToManyNotListRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
   Class<?> relationshipClass = ReflectionUtil.getElementTypeOfList(field.getGenericType());
   if (relationshipClass == null) {
     throw new OneToManyNotGenericsRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
   if (relationshipClass.getAnnotation(Entity.class) == null) {
     throw new RelationshipNotEntityRuntimeException(
         entityMeta.getName(), propertyMeta.getName(), relationshipClass);
   }
   propertyMeta.setRelationshipClass(relationshipClass);
   String mappedBy = oneToMany.mappedBy();
   if (!StringUtil.isEmpty(mappedBy)) {
     if (propertyMeta.getJoinColumnMetaList().size() > 0) {
       throw new BothMappedByAndJoinColumnRuntimeException(
           entityMeta.getName(), propertyMeta.getName());
     }
     propertyMeta.setMappedBy(mappedBy);
   } else {
     throw new MappedByMandatoryRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
 }
Example #5
0
 /**
  * 同じparamKeyの内容をリストで返す
  *
  * @param artistCode
  * @return
  */
 public final List<SenseParamMr> fetchListFronArtistCode(final String paramKey) {
   List<SenseParamMr> ret = InstanceManager.newNotAtomicList();
   if (StringUtil.isBlank(paramKey)) {
     return ret;
   }
   return select().where(new SimpleWhere().eq("paramKey", paramKey)).getResultList();
 }
Example #6
0
  /**
   * SAStrusのユーティリティのMessageResourceUtil.getMessage(key)のラッパー<br>
   * 基本的にConst定義はすべてプロパティファイルに書く<br>
   * 独自にConst定義をすると多言語化が面倒であるため。
   *
   * @param key
   * @return プロパティから取得した文字列
   */
  public static String get(final String key) {

    if (StringUtil.isBlank(key)) {
      return "";
    }
    return MessageResourcesUtil.getMessage(key);
  }
Example #7
0
 /**
  * 例外チェーンをたどって原因となった{@link SQLException#getSQLState() SQLステート}を返します。
  *
  * <p>例外チェーンに{@link SQLException SQL例外}が存在しない場合や、SQLステートが設定されていない場合は <code>null</code>を返します。
  *
  * @param t 例外
  * @return 原因となった{@link SQLException#getSQLState() SQLステート}
  */
 protected String getSQLState(Throwable t) {
   SQLException cause = getCauseSQLException(t);
   if (cause != null && !StringUtil.isEmpty(cause.getSQLState())) {
     return cause.getSQLState();
   }
   return null;
 }
Example #8
0
 @Execute(validator = false)
 public String index() {
   if (StringUtil.isEmpty(page)) {
     throw new IllegalArgumentException("page is null.");
   }
   return page + ".ftl";
 }
 private int getTextValueAsInt() {
   final String text = getTextValue();
   if (StringUtil.isNotEmpty(text)) {
     return Integer.parseInt(text);
   }
   return 0;
 }
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
      throws IOException, ServletException {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;
    String contextPath = req.getContextPath();
    if (contextPath.equals("/")) {
      contextPath = "";
    }
    String path = RequestUtil.getPath(req);
    if (!processDirectAccess(request, response, chain, path)) {
      return;
    }
    reloadRoutes();

    if (path.indexOf('.') < 0) {
      // If the request pass via reverse proxy, the original path must be gotten from HTTP header.
      if (!contextSensitive) {
        path = getOriginalPath(req);
      }
      try {
        Options options = Routes.recognizePath(path);
        String controller = options.getString("controller");
        String action = options.getString("action");
        Options params = options.except("controller", "action");

        String actionPath = ControllerUtil.fromClassNameToPath(controller);
        S2Container container = SingletonS2ContainerFactory.getContainer();
        if (container.hasComponentDef(actionPath.replace('/', '_').concat("Action"))) {
          S2ExecuteConfig executeConfig;
          if (StringUtil.equals(action, "index")) {
            executeConfig = S2ExecuteConfigUtil.findExecuteConfig("/" + actionPath, req);
            action = executeConfig.getMethod().getName();
          } else {
            executeConfig = S2ExecuteConfigUtil.findExecuteConfig("/" + actionPath, action);
          }
          if (executeConfig != null) {
            StringBuilder forwardPath = new StringBuilder(256);
            forwardPath
                .append("/")
                .append(actionPath)
                .append(".do?SAStruts.method=")
                .append(URLEncoderUtil.encode(action));
            for (String key : params.keySet()) {
              forwardPath
                  .append("&")
                  .append(URLEncoderUtil.encode(key))
                  .append("=")
                  .append(URLEncoderUtil.encode(params.getString(key)));
            }
            logger.debug(String.format("recognize route %s as %s#%s.", path, actionPath, action));
            req.getRequestDispatcher(forwardPath.toString()).forward(req, res);
            return;
          }
        }
      } catch (RoutingException e) {
        if (!fallThrough) throw e;
      }
    }
    chain.doFilter(request, response);
  }
 /**
  * @see
  *     org.seasar.framework.xml.sax.handler.TagHandler#end(org.seasar.framework.xml.sax.handler.TagHandlerContext,
  *     java.lang.String)
  */
 public void end(TagHandlerContext context, String body) {
   AspectDef aspectDef = (AspectDef) context.pop();
   if (!StringUtil.isEmpty(body)) {
     aspectDef.setExpression(body);
   }
   ComponentDef componentDef = (ComponentDef) context.peek();
   componentDef.addAspectDef(aspectDef);
 }
Example #12
0
 /**
  * {@link #ignoreWhitespace()}が呼び出された場合でパラメータ値が空文字列または空白のみの文字列なら <code>null</code>を、
  * それ以外なら元の値をそのまま返します。
  *
  * @param value パラメータ値
  * @return {@link #ignoreWhitespace()}が呼び出された場合でパラメータ値が空文字列または空白のみの文字列なら <code>null</code>、
  *     それ以外なら元の値
  */
 protected Object normalize(final Object value) {
   if (excludesWhitespace && value instanceof String) {
     if (StringUtil.isEmpty(String.class.cast(value).trim())) {
       return null;
     }
   }
   return value;
 }
 /**
  * シーケンスの名前を返します。
  *
  * @param entityMeta エンティティメタデータ
  * @param propertyMeta プロパティメタデータ
  * @param sequenceGenerator シーケンスジェネレータ
  * @return シーケンスの名前
  */
 protected String getSequenceName(
     EntityMeta entityMeta, PropertyMeta propertyMeta, SequenceGenerator sequenceGenerator) {
   String sequenceName = sequenceGenerator.sequenceName();
   if (!StringUtil.isEmpty(sequenceName)) {
     return sequenceName;
   }
   return entityMeta.getTableMeta().getName() + "_" + propertyMeta.getColumnMeta().getName();
 }
  /**
   * 名前を処理します。
   *
   * @param entityMeta エンティティメタデータ
   * @param tableDesc テーブル記述
   * @param generator テーブルジェネレータ
   */
  protected void doName(EntityMeta entityMeta, TableDesc tableDesc, TableGenerator generator) {
    String catalog = generator.catalog();
    if (StringUtil.isEmpty(catalog)) {
      catalog = entityMeta.getTableMeta().getCatalog();
    }
    String schema = generator.schema();
    if (StringUtil.isEmpty(schema)) {
      schema = entityMeta.getTableMeta().getSchema();
    }
    String name = generator.table();
    if (StringUtil.isEmpty(name)) {
      name = TableIdGenerator.DEFAULT_TABLE;
    }

    tableDesc.setCatalogName(catalog);
    tableDesc.setSchemaName(schema);
    tableDesc.setName(name);
    tableDesc.setCanonicalName(buildCanonicalName(catalog, schema, name));
  }
 /**
  * @see
  *     org.seasar.framework.xml.sax.handler.TagHandler#start(org.seasar.framework.xml.sax.handler.TagHandlerContext,
  *     org.xml.sax.Attributes)
  */
 public void start(TagHandlerContext context, Attributes attributes) {
   AspectDef aspectDef = null;
   String pointcutStr = attributes.getValue("pointcut");
   if (pointcutStr != null) {
     String[] methodNames = StringUtil.split(pointcutStr, ", ");
     aspectDef = createAspectDef(createPointcut(methodNames));
   } else {
     aspectDef = createAspectDef();
   }
   context.push(aspectDef);
 }
Example #16
0
 public String getSqlBySqlFile(Class daoClass, Method method, String suffix) {
   String base = daoClass.getName().replace('.', '/') + "_" + method.getName();
   String dbmsPath =
       base + (StringUtil.isEmpty(suffix) ? "" : "_" + suffix) + DaoConstants.SQL_EXTENSION;
   String standardPath = base + DaoConstants.SQL_EXTENSION;
   if (ResourceUtil.isExist(dbmsPath)) {
     return TextUtil.readUTF8(dbmsPath);
   } else if (ResourceUtil.isExist(standardPath)) {
     return TextUtil.readUTF8(standardPath);
   }
   return null;
 }
 public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
   EasyApiMessageDto dto = null;
   String nodeName = reader.getNodeName();
   if (StringUtil.equals(nodeName, "request")) {
     dto = new RequestDto();
   } else if (StringUtil.equals(nodeName, "response")) {
     dto = new ResponseDto();
   } else {
     throw new XStreamException("unknown node name");
   }
   while (reader.hasMoreChildren()) {
     reader.moveDown();
     if (StringUtil.equals(reader.getNodeName(), "head")) {
       dto.header = (HeaderDto) context.convertAnother(dto, HeaderDto.class);
     } else if (StringUtil.equals(reader.getNodeName(), "body")) {
       dto.body = context.convertAnother(dto, bodyDtoClass.get());
     }
     reader.moveUp();
   }
   return dto;
 }
 // -----------------------------------------------------
 //                                            Validation
 //                                            ----------
 protected void doSetupValidationConfig(
     S2ExecuteConfig executeConfig,
     S2ActionMapping actionMapping,
     Class<?> actionClass,
     Method method,
     Execute execute,
     String input) {
   final List<S2ValidationConfig> validationConfigs = new ArrayList<S2ValidationConfig>();
   final String validate = execute.validate();
   boolean validator = false;
   if (!StringUtil.isEmpty(validate)) {
     final BeanDesc actionBeanDesc = actionMapping.getActionBeanDesc();
     final BeanDesc actionFormBeanDesc = actionMapping.getActionFormBeanDesc();
     for (String name : StringUtil.split(validate, ", ")) {
       if (VALIDATOR.equals(name)) {
         if (!execute.validator()) {
           throw new UnmatchValidatorAndValidateRuntimeException(actionClass, method.getName());
         }
         validationConfigs.add(createValidationConfig());
         validator = true;
       } else if (actionFormBeanDesc.hasMethod(name)) {
         final Method validateMethod = actionFormBeanDesc.getMethod(name);
         checkValidateMethod(actionClass, validateMethod);
         validationConfigs.add(createValidationConfig(validateMethod));
       } else {
         final Method validateMethod = actionBeanDesc.getMethod(name);
         checkValidateMethod(actionClass, validateMethod);
         validationConfigs.add(createValidationConfig(validateMethod));
       }
     }
   }
   if (!validator && execute.validator()) {
     validationConfigs.add(0, createValidationConfig());
   }
   if (!validationConfigs.isEmpty() && input == null) {
     throw new IllegalValidatorOfExecuteMethodRuntimeException(actionClass, method.getName());
   }
   executeConfig.setValidationConfigs(validationConfigs);
 }
  protected String getOriginalPath(HttpServletRequest req) {
    String path =
        StringUtil.isEmpty(requestUriHeader)
            ? req.getRequestURI()
            : req.getHeader(requestUriHeader);
    if (path == null) return "";

    int len = path.length();
    int i = 0;
    for (; i < len; i++) if (path.charAt(i) == '?' || path.charAt(i) == ';') break;
    if (i != len) path = path.substring(0, i);
    return path;
  }
 /**
  * カラム記述を処理します。
  *
  * @param entityMeta エンティティメタデータ
  * @param propertyMetaList プロパティメタデータのリスト
  * @param tableDesc テーブル記述
  * @param generator テーブルジェネレータ
  */
 protected void doValueColumn(
     EntityMeta entityMeta, TableDesc tableDesc, TableGenerator generator) {
   String valueColumnName = generator.valueColumnName();
   if (StringUtil.isEmpty(valueColumnName)) {
     valueColumnName = TableIdGenerator.DEFAULT_VALUE_COLUMN_NAME;
   }
   ColumnDesc columnDesc = new ColumnDesc();
   columnDesc.setName(valueColumnName);
   SqlType sqlType = dialect.getSqlType(Types.BIGINT);
   columnDesc.setSqlType(sqlType);
   Column column = AnnotationUtil.getDefaultColumn();
   columnDesc.setDefinition(sqlType.getDataType(0, column.precision(), 0, false));
   columnDesc.setNullable(false);
   tableDesc.addColumnDesc(columnDesc);
 }
 // -----------------------------------------------------
 //                                          Reset Method
 //                                          ------------
 protected void doSetupResetMethod(
     S2ExecuteConfig executeConfig, S2ActionMapping actionMapping, Execute execute) {
   final String reset = execute.reset();
   if (!StringUtil.isEmpty(reset)) {
     Method resetMethod = null;
     if ("reset".equals(reset)) {
       resetMethod = actionMapping.getActionFormBeanDesc().getMethodNoException(reset);
     } else {
       resetMethod = actionMapping.getActionFormBeanDesc().getMethod(reset);
     }
     if (resetMethod != null) {
       executeConfig.setResetMethod(resetMethod);
     }
   }
 }
 // ===================================================================================
 //                                                                       ExecuteConfig
 //                                                                       =============
 protected void setupExecuteConfig(
     S2ExecuteConfig executeConfig,
     S2ActionMapping actionMapping,
     Class<?> actionClass,
     Method method) {
   final Execute execute = method.getAnnotation(Execute.class);
   final String input = !StringUtil.isEmpty(execute.input()) ? execute.input() : null;
   executeConfig.setMethod(method);
   executeConfig.setSaveErrors(execute.saveErrors());
   executeConfig.setInput(input);
   doSetupValidationConfig(executeConfig, actionMapping, actionClass, method, execute, input);
   executeConfig.setUrlPattern(execute.urlPattern());
   doSetupRole(executeConfig, execute);
   executeConfig.setStopOnValidationError(execute.stopOnValidationError());
   executeConfig.setRemoveActionForm(execute.removeActionForm());
   doSetupResetMethod(executeConfig, actionMapping, execute);
   executeConfig.setRedirect(execute.redirect());
 }
  /**
   * 主キー記述を処理します。
   *
   * @param entityMeta エンティティメタデータ
   * @param propertyMeta プロパティメタデータ
   * @param tableDesc テーブル記述
   * @param generator テーブルジェネレータ
   */
  protected void doPrimaryKeyColumn(
      EntityMeta entityMeta, TableDesc tableDesc, TableGenerator generator) {
    String pkColumnName = generator.pkColumnName();
    if (StringUtil.isEmpty(pkColumnName)) {
      pkColumnName = TableIdGenerator.DEFAULT_PK_COLUMN_NAME;
    }
    PrimaryKeyDesc primaryKeyDesc = new PrimaryKeyDesc();
    primaryKeyDesc.addColumnName(pkColumnName);
    tableDesc.setPrimaryKeyDesc(primaryKeyDesc);

    ColumnDesc columnDesc = new ColumnDesc();
    columnDesc.setName(pkColumnName);
    SqlType sqlType = dialect.getSqlType(Types.VARCHAR);
    columnDesc.setSqlType(sqlType);
    Column column = AnnotationUtil.getDefaultColumn();
    columnDesc.setDefinition(sqlType.getDataType(column.length(), 0, 0, false));
    tableDesc.addColumnDesc(columnDesc);
  }
 /**
  * 一対一の関連を処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param field フィールド
  * @param entityMeta エンティティメタデータ
  * @param oneToOne 一対一関連
  */
 protected void doOneToOne(
     PropertyMeta propertyMeta, Field field, EntityMeta entityMeta, OneToOne oneToOne) {
   propertyMeta.setRelationshipType(RelationshipType.ONE_TO_ONE);
   Class<?> relationshipClass = field.getType();
   if (relationshipClass.getAnnotation(Entity.class) == null) {
     throw new RelationshipNotEntityRuntimeException(
         entityMeta.getName(), propertyMeta.getName(), relationshipClass);
   }
   propertyMeta.setRelationshipClass(relationshipClass);
   String mappedBy = oneToOne.mappedBy();
   if (!StringUtil.isEmpty(mappedBy)) {
     if (propertyMeta.getJoinColumnMetaList().size() > 0) {
       throw new BothMappedByAndJoinColumnRuntimeException(
           entityMeta.getName(), propertyMeta.getName());
     }
     propertyMeta.setMappedBy(mappedBy);
   }
 }
 /**
  * {@link GenerationType#TABLE}方式で識別子の値を自動生成するIDジェネレータを処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param generatedValue 識別子に付けられた{@link GeneratedValue}アノテーション
  * @param entityMeta エンティティのメタデータ
  * @return {@link GenerationType#TABLE}方式で識別子の値を自動生成するIDジェネレータが存在した場合に <code>true</code>
  */
 protected boolean doTableIdGenerator(
     PropertyMeta propertyMeta, GeneratedValue generatedValue, EntityMeta entityMeta) {
   String name = generatedValue.generator();
   TableGenerator tableGenerator;
   if (StringUtil.isEmpty(name)) {
     tableGenerator = DEFAULT_TABLE_GENERATOR;
   } else {
     tableGenerator = propertyMeta.getField().getAnnotation(TableGenerator.class);
     if (tableGenerator == null || !name.equals(tableGenerator.name())) {
       tableGenerator = entityMeta.getEntityClass().getAnnotation(TableGenerator.class);
       if (tableGenerator == null || !name.equals(tableGenerator.name())) {
         return false;
       }
     }
   }
   propertyMeta.setTableIdGenerator(
       new TableIdGenerator(entityMeta, propertyMeta, tableGenerator));
   return true;
 }
 /**
  * {@link GenerationType#SEQUENCE}方式で識別子の値を自動生成するIDジェネレータを処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param generatedValue 識別子に付けられた{@link GeneratedValue}アノテーション
  * @param entityMeta エンティティのメタデータ
  * @return {@link GenerationType#SEQUENCE}方式で識別子の値を自動生成するIDジェネレータが存在した場合に <code>true</code>
  */
 protected boolean doSequenceIdGenerator(
     PropertyMeta propertyMeta, GeneratedValue generatedValue, EntityMeta entityMeta) {
   String name = generatedValue.generator();
   SequenceGenerator sequenceGenerator;
   if (StringUtil.isEmpty(name)) {
     sequenceGenerator = DEFAULT_SEQUENCE_GENERATOR;
   } else {
     sequenceGenerator = propertyMeta.getField().getAnnotation(SequenceGenerator.class);
     if (sequenceGenerator == null || !name.equals(sequenceGenerator.name())) {
       sequenceGenerator = entityMeta.getEntityClass().getAnnotation(SequenceGenerator.class);
       if (sequenceGenerator == null || !name.equals(sequenceGenerator.name())) {
         return false;
       }
     }
   }
   propertyMeta.setSequenceIdGenerator(
       new SequenceIdGenerator(entityMeta, propertyMeta, sequenceGenerator));
   return true;
 }
 /**
  * テーブルジェネレータを返します。
  *
  * @param entityMeta エンティティメタデータ
  * @param propertyMeta プロパティメタデータ
  * @return テーブルジェネレータ
  */
 protected TableGenerator getTableGenerator(EntityMeta entityMeta, PropertyMeta propertyMeta) {
   Field field = propertyMeta.getField();
   GeneratedValue generatedValue = field.getAnnotation(GeneratedValue.class);
   if (generatedValue == null) {
     throw new IllegalStateException("@GeneratedValue not found.");
   }
   String name = generatedValue.generator();
   if (StringUtil.isEmpty(name)) {
     return AnnotationUtil.getDefaultTableGenerator();
   }
   TableGenerator tableGenerator = field.getAnnotation(TableGenerator.class);
   if (tableGenerator != null && name.equals(tableGenerator.name())) {
     return tableGenerator;
   }
   tableGenerator = entityMeta.getEntityClass().getAnnotation(TableGenerator.class);
   if (tableGenerator != null && name.equals(tableGenerator.name())) {
     return tableGenerator;
   }
   throw new IllegalStateException("@TableGenerator not found.");
 }
  public FacesConfig configure() {
    List configs = new LinkedList();
    String path = getPath();
    if (logger_.isDebugEnabled()) {
      logger_.debug("target file path = " + path);
    }
    if (path == null) {
      return null;
    }
    String[] paths = StringUtil.split(path, FACES_CONFIG_DELIMETER);

    for (int i = 0; i < paths.length; i++) {
      final String targetPath = paths[i];
      final SaxHandlerParser parser = createSaxHandlerParser();
      InputStream is = resourceResolver_.getInputStream(targetPath.trim());
      try {
        configs.add(parser.parse(is, targetPath));
      } finally {
        InputStreamUtil.close(is);
      }
    }
    return FacesConfigUtil.collectAllFacesConfig(configs);
  }
Example #29
0
 public String unquote(String value) {
   String s = StringUtil.ltrim(value, getOpenQuote());
   return StringUtil.rtrim(s, getCloseQuote());
 }
 // -----------------------------------------------------
 //                                                  Role
 //                                                  ----
 protected void doSetupRole(S2ExecuteConfig executeConfig, Execute execute) {
   final String roles = execute.roles().trim();
   if (!StringUtil.isEmpty(roles)) {
     executeConfig.setRoles(StringUtil.split(roles, ", "));
   }
 }