001/*
002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Antoine Taillefer <ataillefer@nuxeo.com>
018 */
019package org.nuxeo.drive.adapter;
020
021import java.io.Serializable;
022import java.util.Calendar;
023
024import org.nuxeo.drive.adapter.impl.AbstractDocumentBackedFileSystemItem;
025import org.nuxeo.drive.adapter.impl.AbstractFileSystemItem;
026import org.nuxeo.ecm.core.api.Lock;
027
028/**
029 * Representation of a file system item, typically a file or a folder.
030 *
031 * @author Antoine Taillefer
032 * @see AbstractFileSystemItem
033 * @see AbstractDocumentBackedFileSystemItem
034 * @see FileItem
035 * @see FolderItem
036 */
037public interface FileSystemItem extends Comparable<FileSystemItem>, Serializable {
038
039    /**
040     * Gets a unique id generated server-side.
041     */
042    String getId();
043
044    /**
045     * Gets the parent {@link FileSystemItem} id.
046     */
047    String getParentId();
048
049    /**
050     * A concatenation of ancestor ids with '/' as prefix and separator.
051     */
052    String getPath();
053
054    /**
055     * Gets the name displayed in the file system.
056     */
057    String getName();
058
059    boolean isFolder();
060
061    String getCreator();
062
063    String getLastContributor();
064
065    Calendar getCreationDate();
066
067    Calendar getLastModificationDate();
068
069    boolean getCanRename();
070
071    void rename(String name);
072
073    boolean getCanDelete();
074
075    void delete();
076
077    Lock getLockInfo();
078
079    boolean canMove(FolderItem dest);
080
081    FileSystemItem move(FolderItem dest);
082
083}