예제 #1
0
  /**
   * Returns a new instance of an archive writer.
   *
   * @param format archive format
   * @param info input info
   * @return writer
   * @throws QueryException query exception
   */
  public static ArchiveOut get(final String format, final InputInfo info) throws QueryException {

    try {
      if (format.equals("zip")) return new ZIPOut();
      if (format.equals("gzip")) return new GZIPOut();
    } catch (final IOException ex) {
      throw ARCH_FAIL.thrw(info, ex);
    }
    throw ARCH_UNKNOWN.thrw(info);
  }