001/*
002 * Syncany, www.syncany.org
003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com>
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation, either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018package org.syncany.plugins.transfer.features;
019
020import java.util.Map;
021
022import org.syncany.plugins.transfer.FileType;
023import org.syncany.plugins.transfer.StorageException;
024import org.syncany.plugins.transfer.TransferManager;
025
026/**
027 * The path aware feature extension must be defined in the {@link PathAware}
028 * feature in order to extend a {@link TransferManager} that was marked as 'path aware'
029 * with the required methods to manage the subfolders. 
030 * 
031 * <p>This extension creates, removes and lists contents in these subfolders.
032 * 
033 * @see PathAware
034 * @see PathAwareFeatureTransferManager
035 * @author Christian Roth (christian.roth@port17.de)
036 */
037public interface PathAwareFeatureExtension extends FeatureExtension {
038        /**
039         * Creates the given sub path / folder on the remote storage.
040         *  
041         * @param path Path/folder to be created
042         * @return True if successful, false otherwise 
043         */
044        public boolean createPath(String path) throws StorageException;
045
046        /**
047         * Deleted the given sub path / folder on the remote storage.
048         *  
049         * @param path Path/folder to be deleted
050         * @return True if successful, false otherwise 
051         */
052        public boolean removeFolder(String path) throws StorageException;
053        
054        /**
055         * Lists the contents of the given sub path / folder on the remote storage.
056         *  
057         * @param path Path/folder to be listed
058         * @return Filename/type list for the given subfolder 
059         */
060        public Map<String, FileType> listFolder(String path) throws StorageException;
061}