Exemplo n.º 1
0
  private static IoItmFil Get_itm_by_filters(Io_url dir, String... filter_ary) {
    // create array of matches based on filters
    int match_ary_len = filter_ary.length;
    Criteria_ioMatch[] match_ary = new Criteria_ioMatch[match_ary_len];
    for (int i = 0; i < match_ary_len; ++i)
      match_ary[i] = Criteria_ioMatch.parse_(true, filter_ary[i], dir.Info().CaseSensitive());

    // get files and check each file for match
    IoItmFil rv = null;
    IoItmHash itm_hash = Io_mgr.I.QueryDir_args(dir).ExecAsItmHash();
    int len = itm_hash.Count();
    for (int i = 0; i < len; ++i) {
      IoItm_base itm = itm_hash.Get_at(i);
      for (int j = 0; j < match_ary_len; ++j) {
        if (itm.Type_fil() && match_ary[j].Matches(itm.Url()))
          rv =
              (IoItmFil)
                  itm; // NOTE: this will return the last match; useful for getting latest dump when
                       // multiple dumps are in one dir; (assuming latest should alphabetize last)
      }
    }
    return rv;
  }
Exemplo n.º 2
0
 public Io_stream_rdr New_rdr(Io_url url) {
   return stdout_enabled
       ? Io_stream_rdr_process.new_(
           stdout_process.Exe_url(), url, stdout_process.Xto_process_bldr_args(url.Raw()))
       : Io_stream_rdr_.bzip2_(url);
 }
Exemplo n.º 3
0
 public boolean Handles(Io_url url) {
   return String_.In(url.Ext(), zip_exts);
 }