001/* 002 * Copyright 2010 Anyware Services 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 */ 016package org.ametys.plugins.repository.metadata; 017 018import java.util.Collection; 019 020import org.ametys.plugins.repository.AmetysRepositoryException; 021 022/** 023 * Interface representing a folder. 024 * @deprecated org.ametys.cms.data.RichText new class doesn't use folder anymore 025 */ 026@Deprecated 027public interface Folder 028{ 029 /** 030 * Returns the folder name. 031 * @return the folder name. 032 * @throws AmetysRepositoryException if an error occurs. 033 */ 034 public String getName() throws AmetysRepositoryException; 035 036 /** 037 * Returns a Collection containing all subfolders of this folder. 038 * @return a Collection containing all subfolders of this folder. 039 * @throws AmetysRepositoryException if an error occurs 040 */ 041 public Collection<? extends Folder> getFolders() throws AmetysRepositoryException; 042 043 /** 044 * Returns the folder with the specified name. 045 * @param folderName the name of the folder. 046 * @return the folder with the specified name. 047 * @throws UnknownMetadataException if the folder does not exist. 048 * @throws AmetysRepositoryException if an error occurs. 049 */ 050 public Folder getFolder(String folderName) throws UnknownMetadataException, AmetysRepositoryException; 051 052 /** 053 * Returns a Collection containing all files of this folder. 054 * @return a Collection containing all files of this folder. 055 * @throws AmetysRepositoryException if an error occurs. 056 */ 057 public Collection<? extends File> getFiles() throws AmetysRepositoryException; 058 059 /** 060 * Tests the existence of a file. 061 * @param fileName the name of the file. 062 * @return true if the specified file exists in this folder. 063 * @throws AmetysRepositoryException if an error occurs. 064 */ 065 public boolean hasFile(String fileName) throws AmetysRepositoryException; 066 067 /** 068 * Returns the file with the specified name. 069 * @param fileName the name of the file. 070 * @return the file with the specified name. 071 * @throws UnknownMetadataException if the folder does not exist. 072 * @throws AmetysRepositoryException if an error occurs. 073 */ 074 public File getFile(String fileName) throws UnknownMetadataException, AmetysRepositoryException; 075}