<commit_before>/*
 * Licensed to DuraSpace under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * DuraSpace licenses this file to you 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.
 */
package org.fcrepo.exporter;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * @author awoods
 * @author escowles
 * @since 2016-08-29
 */
public class Config {

    private String mode;
    private URI resource;
    private File binaryDirectory;
    private File descriptionDirectory;
    private String rdfExtension;
    private String rdfLanguage;

    /**
     * This method returns true if the configuration is set for 'import'
     *
     * @return true if import config
     */
    public boolean isImport() {
        return mode.equalsIgnoreCase("import");
    }

    /**
     * This method returns true if the configuration is set for 'export'
     *
     * @return true if export config
     */
    public boolean isExport() {
        return !isImport();
    }

    /**
     * This method sets the import/export mode
     *
     * @param mode of this configuration
     */
    public void setMode(final String mode) {
        this.mode = mode;
    }

    /**
     * Sets the base directory for binaries.
     */
    public void setBinaryDirectory(final String directory) {
        this.binaryDirectory = directory == null ? null : new File(directory);
    }

    /**
     * Sets the base directory for binaries.
     */
    public void setBinaryDirectory(final File directory) {
        this.binaryDirectory = directory;
    }

    /**
     * Gets the base directory for binaries.
     */
    public File getBinaryDirectory() {
        return binaryDirectory;
    }

    /**
     * Sets the base directory for descriptions.
     */
    public void setDescriptionDirectory(final String directory) {
        this.descriptionDirectory = new File(directory);
    }

    /**
     * Sets the base directory for descriptions.
     */
    public void setDescriptionDirectory(final File directory) {
        this.descriptionDirectory = directory;
    }

    /**
     * Gets the base directory for descriptions.
     */
    public File getDescriptionDirectory() {
        return descriptionDirectory;
    }

    /**
     * Sets the URI of the resource to import/export
     */
    public void setResource(final String resource) throws URISyntaxException {
        setResource(new URI(resource));
    }

    /**
     * Sets the URI of the resource to import/export
     */
    public void setResource(final URI resource) throws URISyntaxException {
        if (resource.toString().endsWith("/")) {
            this.resource = new URI(
                resource.toString().substring(0, resource.toString().length() - 1));
        } else {
            this.resource = resource;
        }
    }

    /**
     * Gets the URI of the resource to import/export
     */
    public URI getResource() {
        return resource;
    }

    /**
     * Sets the RDF filename extension
     */
    public void setRdfExtension(final String extension) {
        this.rdfExtension = extension;
    }

    /**
     * Gets the RDF filename extension
     */
    public String getRdfExtension() {
        return rdfExtension;
    }

    /**
     * Sets the RDF language
     */
    public void setRdfLanguage(final String language) {
        this.rdfLanguage = language;
    }

    /**
     * Gets the RDF language
     */
    public String getRdfLanguage() {
        return rdfLanguage;
    }
}<commit_msg>Clean-up javadoc warnings on mvn build. Address FCREPO-2173.<commit_after>/*
 * Licensed to DuraSpace under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * DuraSpace licenses this file to you 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.
 */
package org.fcrepo.exporter;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * @author awoods
 * @author escowles
 * @since 2016-08-29
 */
public class Config {

    private String mode;
    private URI resource;
    private File binaryDirectory;
    private File descriptionDirectory;
    private String rdfExtension;
    private String rdfLanguage;

    /**
     * This method returns true if the configuration is set for 'import'
     *
     * @return true if import config
     */
    public boolean isImport() {
        return mode.equalsIgnoreCase("import");
    }

    /**
     * This method returns true if the configuration is set for 'export'
     *
     * @return true if export config
     */
    public boolean isExport() {
        return !isImport();
    }

    /**
     * This method sets the import/export mode
     *
     * @param mode of this configuration
     */
    public void setMode(final String mode) {
        this.mode = mode;
    }

    /**
     * Sets the base directory for binaries.
     *
     * @param directory to export to
     */
    public void setBinaryDirectory(final String directory) {
        this.binaryDirectory = directory == null ? null : new File(directory);
    }

    /**
     * Sets the base directory for binaries.
     *
     * @param directory to export binaries to
     */
    public void setBinaryDirectory(final File directory) {
        this.binaryDirectory = directory;
    }

    /**
     * Gets the base directory for binaries.
     *
     * @return binaryDirectory
     */
    public File getBinaryDirectory() {
        return binaryDirectory;
    }

    /**
     * Sets the base directory for descriptions.
     *
     * @param directory to export descriptions to
     */
    public void setDescriptionDirectory(final String directory) {
        this.descriptionDirectory = new File(directory);
    }

    /**
     * Sets the base directory for descriptions.
     *
     * @param directory to export descriptions to
     */
    public void setDescriptionDirectory(final File directory) {
        this.descriptionDirectory = directory;
    }

    /**
     * Gets the base directory for descriptions.
     *
     * @return descriptionDirectory
     */
    public File getDescriptionDirectory() {
        return descriptionDirectory;
    }

    /**
     * Sets the URI of the resource to import/export
     *
     * @param resource URI to import/export
     * @throws URISyntaxException if resource is not URI
     */
    public void setResource(final String resource) throws URISyntaxException {
        setResource(new URI(resource));
    }

    /**
     * Sets the URI of the resource to import/export
     *
     * @param resource URI to import/export
     * @throws URISyntaxException if resource is not URI
     */
    public void setResource(final URI resource) throws URISyntaxException {
        if (resource.toString().endsWith("/")) {
            this.resource = new URI(
                resource.toString().substring(0, resource.toString().length() - 1));
        } else {
            this.resource = resource;
        }
    }

    /**
     * Gets the URI of the resource to import/export
     *
     * @return resource
     */
    public URI getResource() {
        return resource;
    }

    /**
     * Sets the RDF filename extension
     *
     * @param extension of the RDF filename
     */
    public void setRdfExtension(final String extension) {
        this.rdfExtension = extension;
    }

    /**
     * Gets the RDF filename extension
     *
     * @return rdfExtension
     */
    public String getRdfExtension() {
        return rdfExtension;
    }

    /**
     * Sets the RDF language
     *
     * @param language of the exported RDF
     */
    public void setRdfLanguage(final String language) {
        this.rdfLanguage = language;
    }

    /**
     * Gets the RDF language
     *
     * @return rdfLanguage
     */
    public String getRdfLanguage() {
        return rdfLanguage;
    }
}
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.0035603026257231864, 'mean_word_length': 2.323105360443623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5525023', 'n_tokens_mistral': 2355, 'n_tokens_neox': 2280, 'n_words': 836}