001 /* 002 * Copyright (C) 2012 eXo Platform SAS. 003 * 004 * This is free software; you can redistribute it and/or modify it 005 * under the terms of the GNU Lesser General Public License as 006 * published by the Free Software Foundation; either version 2.1 of 007 * the License, or (at your option) any later version. 008 * 009 * This software 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 * You should have received a copy of the GNU Lesser General Public 015 * License along with this software; if not, write to the Free 016 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 017 * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 018 */ 019 package org.crsh.ssh.term.scp; 020 021 import org.crsh.cli.Argument; 022 import org.crsh.cli.Option; 023 import org.crsh.cli.Required; 024 025 public class SCPAction implements Runnable { 026 027 /** . */ 028 @Option(names="r") 029 private Boolean recursive; 030 031 /** . */ 032 @Option(names="v") 033 private Boolean verbose; 034 035 /** . */ 036 @Option(names="p") 037 private Boolean preserve; 038 039 /** . */ 040 @Option(names="f") 041 private Boolean source; 042 043 /** . */ 044 @Option(names="t") 045 private Boolean sink; 046 047 /** . */ 048 @Option(names="d") 049 private Boolean directory; 050 051 /** . */ 052 @Argument 053 @Required 054 private String target; 055 056 public Boolean isRecursive() { 057 return recursive; 058 } 059 060 public void setRecursive(Boolean recursive) { 061 this.recursive = recursive; 062 } 063 064 public Boolean isVerbose() { 065 return verbose; 066 } 067 068 public void setVerbose(Boolean verbose) { 069 this.verbose = verbose; 070 } 071 072 public Boolean isPreserve() { 073 return preserve; 074 } 075 076 public void setPreserve(Boolean preserve) { 077 this.preserve = preserve; 078 } 079 080 public Boolean isSource() { 081 return source; 082 } 083 084 public void setSource(Boolean source) { 085 this.source = source; 086 } 087 088 public Boolean isSink() { 089 return sink; 090 } 091 092 public void setSink(Boolean sink) { 093 this.sink = sink; 094 } 095 096 public Boolean isDirectory() { 097 return directory; 098 } 099 100 public void setDirectory(Boolean directory) { 101 this.directory = directory; 102 } 103 104 public String getTarget() { 105 return target; 106 } 107 108 public void setTarget(String target) { 109 this.target = target; 110 } 111 112 public void run() { 113 // Nothing to do as it is handled by SCPCommandPlugin 114 } 115 116 @Override 117 public String toString() { 118 return "SCPAction[recursive=" + recursive + ",verbose=" + verbose + ",preserve=" + preserve + ",source=" + source + 119 ",sink=" + sink + ",directory=" + directory + ",target=" + target + "]"; 120 } 121 }