All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sigpwned.tabular4j.csv.CsvSpreadsheetFormatFactory Maven / Gradle / Ivy

/*-
 * =================================LICENSE_START==================================
 * spreadsheet4j-csv
 * ====================================SECTION=====================================
 * Copyright (C) 2022 - 2023 Andy Boothe
 * ====================================SECTION=====================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==================================LICENSE_END===================================
 */
package com.sigpwned.tabular4j.csv;

import java.util.Set;
import com.sigpwned.tabular4j.SpreadsheetFormatFactory;
import com.sigpwned.tabular4j.csv.util.Csv;
import com.sigpwned.tabular4j.mime.MimeType;

public class CsvSpreadsheetFormatFactory extends CsvFormatSpreadsheetFormatFactoryBase
    implements SpreadsheetFormatFactory {
  public static final String DEFAULT_FILE_EXTENSION = "csv";

  public static final Set SUPPORTED_FILE_EXTENSIONS = Set.of(DEFAULT_FILE_EXTENSION);

  public static final MimeType DEFAULT_MIME_TYPE = MimeType.of("text", "csv");

  public static final Set SUPPORTED_MIME_TYPES =
      Set.of(DEFAULT_MIME_TYPE, MimeType.of("application", "csv"));

  public CsvSpreadsheetFormatFactory() {
    this(new CsvConfigRegistry());
  }

  public CsvSpreadsheetFormatFactory(CsvConfigRegistry config) {
    super(config, Csv.STANDARD_FILE_FORMAT, DEFAULT_FILE_EXTENSION, SUPPORTED_FILE_EXTENSIONS,
        DEFAULT_MIME_TYPE, SUPPORTED_MIME_TYPES);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy