| | |
| | | package de.micromata.borgbutler; |
| | | |
| | | import de.micromata.borgbutler.config.BorgRepoConfig; |
| | | import lombok.AccessLevel; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | public class BorgCommand { |
| | | private Logger log = LoggerFactory.getLogger(BorgCommand.class); |
| | | |
| | | @Getter |
| | | @Setter |
| | | private File workingDir; |
| | | @Getter |
| | | private String[] args; |
| | | @Getter |
| | | private String[] params; |
| | | @Getter |
| | | @Setter |
| | | private BorgRepoConfig repoConfig; |
| | | @Getter |
| | | @Setter |
| | | private String command; |
| | | @Getter |
| | | @Setter |
| | | private String archive; |
| | | /** |
| | | * For displaying and information purposes for the user only, when browsing the current command queue. |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | private String description; |
| | | /** |
| | | * The result of the call will be written to this String. |
| | | */ |
| | | @Getter |
| | | @Setter(AccessLevel.PACKAGE) |
| | | private String response; |
| | | |
| | | BorgCommand setArgs(String... args) { |
| | |
| | | public String getAbbreviatedResponse() { |
| | | return StringUtils.abbreviate(response, 1000); |
| | | } |
| | | |
| | | public File getWorkingDir() { |
| | | return this.workingDir; |
| | | } |
| | | |
| | | public String[] getArgs() { |
| | | return this.args; |
| | | } |
| | | |
| | | public String[] getParams() { |
| | | return this.params; |
| | | } |
| | | |
| | | public BorgRepoConfig getRepoConfig() { |
| | | return this.repoConfig; |
| | | } |
| | | |
| | | public String getCommand() { |
| | | return this.command; |
| | | } |
| | | |
| | | public String getArchive() { |
| | | return this.archive; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return this.description; |
| | | } |
| | | |
| | | public String getResponse() { |
| | | return this.response; |
| | | } |
| | | |
| | | public BorgCommand setWorkingDir(File workingDir) { |
| | | this.workingDir = workingDir; |
| | | return this; |
| | | } |
| | | |
| | | public BorgCommand setRepoConfig(BorgRepoConfig repoConfig) { |
| | | this.repoConfig = repoConfig; |
| | | return this; |
| | | } |
| | | |
| | | public BorgCommand setCommand(String command) { |
| | | this.command = command; |
| | | return this; |
| | | } |
| | | |
| | | public BorgCommand setArchive(String archive) { |
| | | this.archive = archive; |
| | | return this; |
| | | } |
| | | |
| | | public BorgCommand setDescription(String description) { |
| | | this.description = description; |
| | | return this; |
| | | } |
| | | |
| | | BorgCommand setResponse(String response) { |
| | | this.response = response; |
| | | return this; |
| | | } |
| | | } |