<commit_before>/*
 *  Copyright(c) 2003-2004 by the authors indicated in the @author tags.
 *
 *  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.
 */
package org.tigris.subversion.svnclientadapter;

import java.io.File;
import java.util.Date;

/**
 * <p>
 * A special status class that is used if a File/Folder is not versioned.</p>
 * 
 * @author <NAME> (schatz at tigris)
 * @author <NAME> (cchabanois at no-log.org)
 */
public class SVNStatusUnversioned implements ISVNStatus {
    private File file;
    private boolean isIgnored = false;
	
    public SVNStatusUnversioned(File file, boolean isIgnored) {
        this.file = file;
        // A file can be both unversioned and ignored.
        this.isIgnored = isIgnored;
    }
    
	public SVNStatusUnversioned(File file) {
		this.file = file;
	}
    
	public SVNUrl getUrl() {
		return null;
	}

	public SVNRevision.Number getLastChangedRevision() {
		return null;
	}

	public Date getLastChangedDate() {
		return null;
	}

	public String getLastCommitAuthor() {
		return null;
	}

	public SVNStatusKind getTextStatus() {
        if (isIgnored) {
        	return SVNStatusKind.IGNORED;
        }
    	return SVNStatusKind.UNVERSIONED;
	}
	
    /**
     * @return As this status does not describe a managed resource, we
     * cannot pretend that there is property status, and thus always
     * return {@link SVNStatusKind#NONE}.
     */
	public SVNStatusKind getPropStatus() {
		return SVNStatusKind.NONE;
	}
	
    public SVNStatusKind getRepositoryTextStatus() {
        return SVNStatusKind.UNVERSIONED;
    }

    public SVNStatusKind getRepositoryPropStatus() {
        return SVNStatusKind.UNVERSIONED;
    }

	public SVNRevision.Number getRevision() {
		return SVNRevision.INVALID_REVISION;
	}

	public boolean isCopied() {
		return false;
	}

	public String getPath() {
		return file.getPath();
	}

    public File getFile() {
        return file.getAbsoluteFile();
    }
    
    /**
     * @return As this status does not describe a managed resource, we
     * cannot pretend to know the node kind, and thus always return
     * {@link SVNNodeKind#UNKNOWN}.
     */<commit_msg>Changed getRevision() in SVNStatusUnversioned to return null instead of -1. This way (our) unversioned status behaves the same way as unversioned status returned by jhl or javasvn. It does not seem to be directly used in subclipse so I don't expect any negative side-effects there.<commit_after>/*
 *  Copyright(c) 2003-2004 by the authors indicated in the @author tags.
 *
 *  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.
 */
package org.tigris.subversion.svnclientadapter;

import java.io.File;
import java.util.Date;

/**
 * <p>
 * A special status class that is used if a File/Folder is not versioned.</p>
 * 
 * @author <NAME>z (schatz at tigris)
 * @author <NAME> (cchabanois at no-log.org)
 */
public class SVNStatusUnversioned implements ISVNStatus {
    private File file;
    private boolean isIgnored = false;
	
    public SVNStatusUnversioned(File file, boolean isIgnored) {
        this.file = file;
        // A file can be both unversioned and ignored.
        this.isIgnored = isIgnored;
    }
    
	public SVNStatusUnversioned(File file) {
		this.file = file;
	}
    
	public SVNUrl getUrl() {
		return null;
	}

	public SVNRevision.Number getLastChangedRevision() {
		return null;
	}

	public Date getLastChangedDate() {
		return null;
	}

	public String getLastCommitAuthor() {
		return null;
	}

	public SVNStatusKind getTextStatus() {
        if (isIgnored) {
        	return SVNStatusKind.IGNORED;
        }
    	return SVNStatusKind.UNVERSIONED;
	}
	
    /**
     * @return As this status does not describe a managed resource, we
     * cannot pretend that there is property status, and thus always
     * return {@link SVNStatusKind#NONE}.
     */
	public SVNStatusKind getPropStatus() {
		return SVNStatusKind.NONE;
	}
	
    public SVNStatusKind getRepositoryTextStatus() {
        return SVNStatusKind.UNVERSIONED;
    }

    public SVNStatusKind getRepositoryPropStatus() {
        return SVNStatusKind.UNVERSIONED;
    }

	public SVNRevision.Number getRevision() {
		return null;
	}

	public boolean isCopied() {
		return false;
	}

	public String getPath() {
		return file.getPath();
	}

    public File getFile() {
        return file.getAbsoluteFile();
    }
    
    /**
     * @return As this status does not describe a managed resource, we
     * cannot pretend to know the node kind, and thus always return
     * {@link SVNNodeKind#UNKNOWN}.
     */
{'fraction_non_alphanumeric': 0.08226822682268227, 'fraction_numerical': 0.004500450045004501, 'mean_word_length': 3.094325718496684, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3142478', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1630, 'n_words': 578}