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.config.to;
019
020import org.simpleframework.xml.Element;
021import org.simpleframework.xml.Root;
022import org.syncany.operations.watch.WatchOperation;
023import org.syncany.operations.watch.WatchOperationOptions;
024
025/**
026 * This class is the access object to configure a folder
027 * managed by the daemon. It defines whether a folder is enabled/disabled,
028 * and with which {@link WatchOperationOptions} to start the {@link WatchOperation}
029 * in the daemon. This class is part of the daemon configuration in {@link DaemonConfigTO}. 
030 * 
031 * <p>It uses the Simple framework for XML serialization, and its corresponding
032 * annotation-based configuration.
033 *
034 * @see <a href="http://simple.sourceforge.net/">Simple framework</a>
035 * @author Philipp C. Heckel (philipp.heckel@gmail.com)
036 */
037@Root(strict = false)
038public class FolderTO {
039        @Element(name="path")
040        private String path;
041
042        @Element(name="enabled", required=false) 
043        private boolean enabled = true;
044        
045        @Element(name="watch", required = false)
046        private WatchOperationOptions watchOptions;
047
048        public FolderTO() {
049                // Nothing!
050        }
051        
052        public FolderTO(String path) {
053                this.path = path;
054        }
055        
056        public String getPath() {
057                return path;
058        }
059
060        public void setPath(String path) {
061                this.path = path;
062        }       
063
064        public boolean isEnabled() {
065                return enabled;
066        }
067
068        public void setEnabled(boolean enabled) {
069                this.enabled = enabled;
070        }
071
072        public WatchOperationOptions getWatchOptions() {
073                return watchOptions;
074        }
075
076        public void setWatchOptions(WatchOperationOptions watchOptions) {
077                this.watchOptions = watchOptions;
078        }
079}