<commit_before>/*
 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * Contributors:
 *     <NAME> <<EMAIL>>
 */
package org.nuxeo.drive.adapter.impl;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import org.nuxeo.drive.adapter.FileItem;
import org.nuxeo.drive.adapter.FileSystemItem;
import org.nuxeo.drive.adapter.FolderItem;
import org.nuxeo.ecm.core.api.Blob;
import org.nuxeo.ecm.core.api.ClientException;

/**
 * Default implementation of the top level {@link FolderItem}.
 *
 * @author <NAME>
 */
public class DefaultTopLevelFolderItem extends AbstractFileSystemItem implements
        FolderItem {

    public DefaultTopLevelFolderItem(String factoryName) {
        super(factoryName);
    }

    /*--------------------- AbstractFileSystemItem ---------------------*/
    @Override
    public String getParentId() {
        return null;
    }

    @Override
    public String getName() {
        return "Nuxeo Drive";
    }

    @Override
    public boolean isFolder() {
        return true;
    }

    @Override
    public String getCreator() {
        return "system";
    }

    @Override
    public Calendar getCreationDate() {
        Calendar cal = Calendar.getInstance();
        cal.set(2012, 11, 12, 12, 12, 12);
        return cal;
    }

    @Override
    public Calendar getLastModificationDate() {
        return getCreationDate();
    }

    @Override
    public void rename(String name) throws ClientException {
        throw new UnsupportedOperationException(
                "Cannot rename a system folder item.");
    }

    @Override
    public void delete() throws ClientException {
        throw new UnsupportedOperationException(
                "Cannot delete a system folder item.");
    }<commit_msg>NXP-10630: Implement #getCanRename and #getCanDelete<commit_after>/*
 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * Contributors:
 *     <NAME> <<EMAIL>>
 */
package org.nuxeo.drive.adapter.impl;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import org.nuxeo.drive.adapter.FileItem;
import org.nuxeo.drive.adapter.FileSystemItem;
import org.nuxeo.drive.adapter.FolderItem;
import org.nuxeo.ecm.core.api.Blob;
import org.nuxeo.ecm.core.api.ClientException;

/**
 * Default implementation of the top level {@link FolderItem}.
 *
 * @author <NAME>
 */
public class DefaultTopLevelFolderItem extends AbstractFileSystemItem implements
        FolderItem {

    public DefaultTopLevelFolderItem(String factoryName) {
        super(factoryName);
    }

    /*--------------------- AbstractFileSystemItem ---------------------*/
    @Override
    public String getParentId() {
        return null;
    }

    @Override
    public String getName() {
        return "Nuxeo Drive";
    }

    @Override
    public boolean isFolder() {
        return true;
    }

    @Override
    public String getCreator() {
        return "system";
    }

    @Override
    public Calendar getCreationDate() {
        Calendar cal = Calendar.getInstance();
        cal.set(2012, 11, 12, 12, 12, 12);
        return cal;
    }

    @Override
    public Calendar getLastModificationDate() {
        return getCreationDate();
    }

    @Override
    public boolean getCanRename() {
        return false;
    }

    @Override
    public void rename(String name) throws ClientException {
        throw new UnsupportedOperationException(
                "Cannot rename a system folder item.");
    }

    @Override
    public boolean getCanDelete() {
        return false;
    }

    @Override
    public void delete() throws ClientException {
        throw new UnsupportedOperationException(
                "Cannot delete a system folder item.");
    }
{'fraction_non_alphanumeric': 0.10404145077720207, 'fraction_numerical': 0.00932642487046632, 'mean_word_length': 2.7295208655332304, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5569074', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1269, 'n_words': 424}