<commit_before>/**
 * Copyright (C) 2009-2012 Simonsoft Nordic AB
 *
 * 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 se.simonsoft.cms.item;

import java.io.IOException;
import java.io.OutputStream;

import se.simonsoft.cms.item.properties.CmsItemProperties;

/**
 * Models a specific revision of a file or folder entry in the CMS.
 * 
 * The interfaces in this package are provided as a means of handling CMS contents
 * that is independent of retrieval method. Data could originate from repository access,
 * working copy, index, cache etc. and might be fetched as needed instead of at instantiation.
 * 
 * Implementations may delay fetching of {@link #getProperties()} and {@link #getContents(OutputStream)}
 * but if the item was instantiated with HEAD revision both properties and contents
 * should be fetched from the revision that was HEAD at the time.
 */
public interface CmsItem {

	CmsItemId getId();
	
	/**
	 * The definition of commit revision at move etc is up to the backend, still.
	 * @return the commit revision of the fetched item, often called "last changed"
	 */
	RepoRevision getRevision();
	
	/**
	 * Item "kind" can not be identified from {@link #getId()}.
	 * @return file or folder or special kinds
	 */
	CmsItemKind getKind();
	
	/**
	 * @return Item status value, arbitrary value (enum defined per customer), null if not set
	 */
	String getStatus();	
	
	/**<commit_msg>Free up the more generic getRevision method name for use in adapter. Good idea to specify this anyway, so that we can make the distinction between "last changed" and "path" revisions in future code. Should we add getRevisionPath() immediately? Problem is I can't get it from svnkit's SVNDirEntry, where there's only getRevision()<commit_after>/**
 * Copyright (C) 2009-2012 Simonsoft Nordic AB
 *
 * 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 se.simonsoft.cms.item;

import java.io.IOException;
import java.io.OutputStream;

import se.simonsoft.cms.item.properties.CmsItemProperties;

/**
 * Models a specific revision of a file or folder entry in the CMS.
 * 
 * The interfaces in this package are provided as a means of handling CMS contents
 * that is independent of retrieval method. Data could originate from repository access,
 * working copy, index, cache etc. and might be fetched as needed instead of at instantiation.
 * 
 * Implementations may delay fetching of {@link #getProperties()} and {@link #getContents(OutputStream)}
 * but if the item was instantiated with HEAD revision both properties and contents
 * should be fetched from the revision that was HEAD at the time.
 */
public interface CmsItem {

	CmsItemId getId();
	
	/**
	 * The revision when this item in its current state (contents and properties) was committed.
	 * Note that this could have happened at a different path than current.
	 * @return the commit revision of the fetched item, often called "last changed"
	 */
	RepoRevision getRevisionChanged();
	
	/**
	 * Should we complement getRevisionChanged()?
	 * @return first revision when this item was available at its current path with its current contents
	 */
	//RepoRevision getRevisionPath();
	
	/**
	 * Item "kind" can not be identified from {@link #getId()}.
	 * @return file or folder or special kinds
	 */
	CmsItemKind getKind();
	
	/**
	 * @return Item status value, arbitrary value (enum defined per customer), null if not set
	 */
	String getStatus();	
	
	/**
{'fraction_non_alphanumeric': 0.07751067175915524, 'fraction_numerical': 0.0053920467310716695, 'mean_word_length': 3.8923076923076922, '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': '2883687', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1107, 'n_words': 583}