001/* 002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Antoine Taillefer <ataillefer@nuxeo.com> 016 */ 017package org.nuxeo.drive.adapter; 018 019import java.io.Serializable; 020import java.util.Calendar; 021 022import org.nuxeo.drive.adapter.impl.AbstractDocumentBackedFileSystemItem; 023import org.nuxeo.drive.adapter.impl.AbstractFileSystemItem; 024 025/** 026 * Representation of a file system item, typically a file or a folder. 027 * 028 * @author Antoine Taillefer 029 * @see AbstractFileSystemItem 030 * @see AbstractDocumentBackedFileSystemItem 031 * @see FileItem 032 * @see FolderItem 033 */ 034public interface FileSystemItem extends Comparable<FileSystemItem>, Serializable { 035 036 /** 037 * Gets a unique id generated server-side. 038 */ 039 String getId(); 040 041 /** 042 * Gets the parent {@link FileSystemItem} id. 043 */ 044 String getParentId(); 045 046 /** 047 * A concatenation of ancestor ids with '/' as prefix and separator. 048 */ 049 String getPath(); 050 051 /** 052 * Gets the name displayed in the file system. 053 */ 054 String getName(); 055 056 boolean isFolder(); 057 058 String getCreator(); 059 060 String getLastContributor(); 061 062 Calendar getCreationDate(); 063 064 Calendar getLastModificationDate(); 065 066 boolean getCanRename(); 067 068 void rename(String name); 069 070 boolean getCanDelete(); 071 072 void delete(); 073 074 boolean canMove(FolderItem dest); 075 076 FileSystemItem move(FolderItem dest); 077 078}