<commit_before>package org.wyona.yanel.impl.resources;

import org.apache.log4j.Category;

/**
 *
 */
public class CalendarEvent {
    private static Category log = Category.getInstance(CalendarEvent.class);

    private String uid;
    private String summary;
    private String location;
    private String _class;
    private String categories;
    private String created;
    private String lastModified;
    private String dtstamp;
    private String start;
    private String end;

    /**
     *
     */
    public String getUID() {
        return uid;
    }

    /**
     *
     */
    public void setUID(String uid) {
        this.uid = uid;
    }

    /**
     *
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     *
     */
    public void setLocation(String location) {
        this.location = location;
    }

    /**
     *
     */
    public void setClass(String _class) {
        this._class = _class;
    }

    /**
     *
     */
    public void setCategories(String categories) {
        this.categories = categories;
    }

    /**
     *
     */
    public void setCreated(String created) {
        this.created = created;
    }

    /**
     *
     */
    public void setLastModified(String lastModified) {
        this.lastModified = lastModified;
    }

    /**
     *
     */
    public void setDtstamp(String dtstamp) {
        this.dtstamp = dtstamp;
    }

    /**
     *
     */
    public void setStart(String start) {
        this.start = start;
    }

    /**
     *
     */
    public void setEnd(String end) {
        this.start = end;
    }

    /**
     *
     */
    public String toString() {
        return "ICS Event: " + uid + ", " + summary;
    }

    /**
     *
     */
    public String toXML() {
        StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"?>");
        sb.append("<cal:event xmlns:cal=\"http://...\" created=\"" + created + "\" last-modified=\"" + lastModified + "\" dtstamp=\"" + dtstamp + "\" uid=\"" + uid + "\" class=\"" + _class + "\" categories=\"" + categories + "\">");
        sb.append("  <cal:summary>" + summary + "</cal:summary>");
        sb.append("  <cal:location>" + location + "</cal:location>");
        sb.append("  <cal:dtstart value=\"DATE\" tzid=\"" + start + "\"/>");
        sb.append("  <cal:dtend value=\"DATE\" tzid=\"" + end + "\"/>");
        sb.append("</cal:event>");
        return sb.toString();
    }

    /**
     * @param icsLine UID:..., CREATED:..., ...
     */
    public void setProperty(String icsLine) {
        if (icsLine.startsWith("UID:")) {
            setUID(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("SUMMARY:")) {
            setSummary(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("LOCATION:")) {
            setLocation(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CLASS:")) {
            setClass(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CATEGORIES:")) {
            setCategories(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CREATED:")) {
            setCreated(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("LAST-MODIFIED:")) {<commit_msg>dtend fixed and location checked<commit_after>package org.wyona.yanel.impl.resources;

import org.apache.log4j.Category;

/**
 *
 */
public class CalendarEvent {
    private static Category log = Category.getInstance(CalendarEvent.class);

    private String uid;
    private String summary;
    private String location;
    private String _class;
    private String categories;
    private String created;
    private String lastModified;
    private String dtstamp;
    private String start;
    private String end;

    /**
     *
     */
    public String getUID() {
        return uid;
    }

    /**
     *
     */
    public void setUID(String uid) {
        this.uid = uid;
    }

    /**
     *
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     *
     */
    public void setLocation(String location) {
        this.location = location;
    }

    /**
     *
     */
    public void setClass(String _class) {
        this._class = _class;
    }

    /**
     *
     */
    public void setCategories(String categories) {
        this.categories = categories;
    }

    /**
     *
     */
    public void setCreated(String created) {
        this.created = created;
    }

    /**
     *
     */
    public void setLastModified(String lastModified) {
        this.lastModified = lastModified;
    }

    /**
     *
     */
    public void setDtstamp(String dtstamp) {
        this.dtstamp = dtstamp;
    }

    /**
     *
     */
    public void setStart(String start) {
        this.start = start;
    }

    /**
     *
     */
    public void setEnd(String end) {
        this.end = end;
    }

    /**
     *
     */
    public String toString() {
        return "ICS Event: " + uid + ", " + summary;
    }

    /**
     *
     */
    public String toXML() {
        StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"?>");
        sb.append("<cal:event xmlns:cal=\"http://...\" created=\"" + created + "\" last-modified=\"" + lastModified + "\" dtstamp=\"" + dtstamp + "\" uid=\"" + uid + "\" class=\"" + _class + "\" categories=\"" + categories + "\">");
        sb.append("  <cal:summary>" + summary + "</cal:summary>");
        if(location != null) sb.append("  <cal:location>" + location + "</cal:location>");
        sb.append("  <cal:dtstart value=\"DATE\" tzid=\"" + start + "\"/>");
        sb.append("  <cal:dtend value=\"DATE\" tzid=\"" + end + "\"/>");
        sb.append("</cal:event>");
        return sb.toString();
    }

    /**
     * @param icsLine UID:..., CREATED:..., ...
     */
    public void setProperty(String icsLine) {
        if (icsLine.startsWith("UID:")) {
            setUID(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("SUMMARY:")) {
            setSummary(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("LOCATION:")) {
            setLocation(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CLASS:")) {
            setClass(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CATEGORIES:")) {
            setCategories(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("CREATED:")) {
            setCreated(icsLine.split(":")[1]);
        } else if (icsLine.startsWith("LAST-MODIFIED:")) {
{'fraction_non_alphanumeric': 0.1709796672828096, 'fraction_numerical': 0.0027726432532347504, 'mean_word_length': 1.9460072595281306, 'pattern_counts': {'":': 12, '<': 21, '<?xml version=': 2, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4828743', 'n_tokens_mistral': 2032, 'n_tokens_neox': 1999, 'n_words': 390}