コード例 #1
0
  public static synchronized Map<String, AXlsTableBinder> getBinderFactory() {

    if (binderFactory == null) {
      binderFactory = new HashMap<String, AXlsTableBinder>();

      for (int i = 0; i < BINDERS.length; i++) {

        try {
          binderFactory.put(
              BINDERS[i][0], (AXlsTableBinder) Class.forName(BINDERS[i][1]).newInstance());
        } catch (Exception ex) {
          throw RuntimeExceptionWrapper.wrap(ex);
        }
      }
    }

    return binderFactory;
  }
コード例 #2
0
  /**
   * @param string
   * @param string2
   * @param v
   */
  public static void makeWildcardPath(File root, List<URL> urls) {

    ISelector<File> sel =
        new ASelector<File>() {
          public boolean select(File f) {
            String apath = f.getAbsolutePath();
            boolean res = apath.endsWith(".jar") || apath.endsWith(".zip");
            return res;
          }
        };

    Iterator<File> iter = new FileTreeIterator(root, 0).select(sel);

    for (; iter.hasNext(); ) {
      File f = iter.next();
      try {
        urls.add(f.toURI().toURL());
      } catch (MalformedURLException e) {
        throw RuntimeExceptionWrapper.wrap(e);
      }
    }
  }