Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277543 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
1128f49486
2 changed files with 84 additions and 37 deletions
  1. +56
    -36
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
  2. +28
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCmd.java

+ 56
- 36
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2004 The Apache Software Foundation
* Copyright 2002-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import org.apache.tools.ant.types.Path;
/** /**
* A base class for creating tasks for executing commands on SourceOffSite. * A base class for creating tasks for executing commands on SourceOffSite.
* *
* These tasks were inspired by the VSS tasks
* These tasks were inspired by the VSS tasks.
* *
*/ */


@@ -52,7 +52,7 @@ public abstract class SOS extends Task implements SOSCmd {
private boolean recursive = false; private boolean recursive = false;
private boolean verbose = false; private boolean verbose = false;


/** Commandline to be executed */
/** Commandline to be executed. */
protected Commandline commandLine; protected Commandline commandLine;


/** /**
@@ -79,7 +79,7 @@ public abstract class SOS extends Task implements SOSCmd {
* The directory where soscmd(.exe) is located. * The directory where soscmd(.exe) is located.
* soscmd must be on the path if omitted. * soscmd must be on the path if omitted.
* *
* @param dir The new sosCmd value
* @param dir The new sosCmd value.
*/ */
public final void setSosCmd(String dir) { public final void setSosCmd(String dir) {
sosCmdDir = Project.translatePath(dir); sosCmdDir = Project.translatePath(dir);
@@ -88,7 +88,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* The SourceSafe username. * The SourceSafe username.
* *
* @param username The new username value
* @param username The new username value.
* *
* @ant.attribute group="required" * @ant.attribute group="required"
*/ */
@@ -99,7 +99,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* The SourceSafe password. * The SourceSafe password.
* *
* @param password The new password value
* @param password The new password value.
*/ */
public final void setPassword(String password) { public final void setPassword(String password) {
sosPassword = password; sosPassword = password;
@@ -108,7 +108,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* The SourceSafe project path. * The SourceSafe project path.
* *
* @param projectpath The new projectpath value
* @param projectpath The new projectpath value.
* *
* @ant.attribute group="required" * @ant.attribute group="required"
*/ */
@@ -123,7 +123,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* The path to the location of the ss.ini file. * The path to the location of the ss.ini file.
* *
* @param vssServerPath The new vssServerPath value
* @param vssServerPath The new vssServerPath value.
* *
* @ant.attribute group="required" * @ant.attribute group="required"
*/ */
@@ -134,7 +134,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* Path to the SourceOffSite home directory. * Path to the SourceOffSite home directory.
* *
* @param sosHome The new sosHome value
* @param sosHome The new sosHome value.
*/ */
public final void setSosHome(String sosHome) { public final void setSosHome(String sosHome) {
this.sosHome = sosHome; this.sosHome = sosHome;
@@ -144,7 +144,7 @@ public abstract class SOS extends Task implements SOSCmd {
* The address and port of SourceOffSite Server, * The address and port of SourceOffSite Server,
* for example 192.168.0.1:8888. * for example 192.168.0.1:8888.
* *
* @param sosServerPath The new sosServerPath value
* @param sosServerPath The new sosServerPath value.
* *
* @ant.attribute group="required" * @ant.attribute group="required"
*/ */
@@ -155,7 +155,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* Override the working directory and get to the specified path. * Override the working directory and get to the specified path.
* *
* @param path The new localPath value
* @param path The new localPath value.
*/ */
public final void setLocalPath(Path path) { public final void setLocalPath(Path path) {
localPath = path.toString(); localPath = path.toString();
@@ -172,22 +172,42 @@ public abstract class SOS extends Task implements SOSCmd {


// Special setters for the sub-classes // Special setters for the sub-classes


/**
* Set the file name.
* @param file the filename to use.
*/
protected void setInternalFilename(String file) { protected void setInternalFilename(String file) {
filename = file; filename = file;
} }


/**
* Set the recursive flag.
* @param recurse if true use the recursive flag on the command line.
*/
protected void setInternalRecursive(boolean recurse) { protected void setInternalRecursive(boolean recurse) {
recursive = recurse; recursive = recurse;
} }


/**
* Set the comment text.
* @param text the comment text to use.
*/
protected void setInternalComment(String text) { protected void setInternalComment(String text) {
comment = text; comment = text;
} }


/**
* Set the label.
* @param text the label to use.
*/
protected void setInternalLabel(String text) { protected void setInternalLabel(String text) {
label = text; label = text;
} }


/**
* Set the version.
* @param text the version to use.
*/
protected void setInternalVersion(String text) { protected void setInternalVersion(String text) {
version = text; version = text;
} }
@@ -195,7 +215,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* Get the executable to run. Add the path if it was specifed in the build file * Get the executable to run. Add the path if it was specifed in the build file
* *
* @return the executable to run
* @return the executable to run.
*/ */
protected String getSosCommand() { protected String getSosCommand() {
if (sosCmdDir == null) { if (sosCmdDir == null) {
@@ -207,7 +227,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the comment * Get the comment
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getComment() { protected String getComment() {
return comment; return comment;
@@ -215,7 +235,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the version * Get the version
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getVersion() { protected String getVersion() {
return version; return version;
@@ -223,7 +243,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the label * Get the label
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getLabel() { protected String getLabel() {
return label; return label;
@@ -231,7 +251,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the username * Get the username
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getUsername() { protected String getUsername() {
return sosUsername; return sosUsername;
@@ -239,7 +259,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the password * Get the password
* @return empty string if it wans't set
* @return empty string if it wasn't set.
*/ */
protected String getPassword() { protected String getPassword() {
return sosPassword; return sosPassword;
@@ -247,7 +267,7 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the project path * Get the project path
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getProjectPath() { protected String getProjectPath() {
return projectPath; return projectPath;
@@ -255,68 +275,68 @@ public abstract class SOS extends Task implements SOSCmd {


/** /**
* Get the VSS server path * Get the VSS server path
* @return if it was set, null if not
* @return if it was set, null if not.
*/ */
protected String getVssServerPath() { protected String getVssServerPath() {
return vssServerPath; return vssServerPath;
} }


/** /**
* Get the SOS home directory
* @return if it was set, null if not
* Get the SOS home directory.
* @return if it was set, null if not.
*/ */
protected String getSosHome() { protected String getSosHome() {
return sosHome; return sosHome;
} }


/** /**
* Get the SOS serve path
* @return if it was set, null if not
* Get the SOS serve path.
* @return if it was set, null if not.
*/ */
protected String getSosServerPath() { protected String getSosServerPath() {
return sosServerPath; return sosServerPath;
} }


/** /**
* Get the filename to be acted upon
* @return if it was set, null if not
* Get the filename to be acted upon.
* @return if it was set, null if not.
*/ */
protected String getFilename() { protected String getFilename() {
return filename; return filename;
} }


/** /**
* Get the NoCompress flag
* Get the NoCompress flag.
* *
* @return the 'nocompress' Flag if the attribute was 'true', * @return the 'nocompress' Flag if the attribute was 'true',
* otherwise an empty string
* otherwise an empty string.
*/ */
protected String getNoCompress() { protected String getNoCompress() {
return noCompress ? FLAG_NO_COMPRESSION : ""; return noCompress ? FLAG_NO_COMPRESSION : "";
} }


/** /**
* Get the NoCache flag
* Get the NoCache flag.
* *
* @return the 'nocache' Flag if the attribute was 'true', otherwise an empty string
* @return the 'nocache' Flag if the attribute was 'true', otherwise an empty string.
*/ */
protected String getNoCache() { protected String getNoCache() {
return noCache ? FLAG_NO_CACHE : ""; return noCache ? FLAG_NO_CACHE : "";
} }


/** /**
* Get the 'verbose' Flag
* Get the 'verbose' Flag.
* *
* @return the 'verbose' Flag if the attribute was 'true', otherwise an empty string
* @return the 'verbose' Flag if the attribute was 'true', otherwise an empty string.
*/ */
protected String getVerbose() { protected String getVerbose() {
return verbose ? FLAG_VERBOSE : ""; return verbose ? FLAG_VERBOSE : "";
} }


/** /**
* Get the 'recursive' Flag
* Get the 'recursive' Flag.
* *
* @return the 'recursive' Flag if the attribute was 'true', otherwise an empty string
* @return the 'recursive' Flag if the attribute was 'true', otherwise an empty string.
*/ */
protected String getRecursive() { protected String getRecursive() {
return recursive ? FLAG_RECURSION : ""; return recursive ? FLAG_RECURSION : "";
@@ -325,9 +345,9 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* Builds and returns the working directory. * Builds and returns the working directory.
* <p> * <p>
* The localpath is created if it didn't exist
* The localpath is created if it didn't exist.
* *
* @return the absolute path of the working directory
* @return the absolute path of the working directory.
*/ */
protected String getLocalPath() { protected String getLocalPath() {
if (localPath == null) { if (localPath == null) {
@@ -359,7 +379,7 @@ public abstract class SOS extends Task implements SOSCmd {
/** /**
* Execute the created command line. * Execute the created command line.
* *
* @throws BuildException
* @throws BuildException on error.
*/ */
public void execute() public void execute()
throws BuildException { throws BuildException {


+ 28
- 1
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCmd.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2004 The Apache Software Foundation
* Copyright 2002-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -22,31 +22,58 @@ package org.apache.tools.ant.taskdefs.optional.sos;
*/ */
public interface SOSCmd { public interface SOSCmd {
// soscmd Command options // soscmd Command options
/** The sos executable */
String COMMAND_SOS_EXE = "soscmd"; String COMMAND_SOS_EXE = "soscmd";
/** The get file command */
String COMMAND_GET_FILE = "GetFile"; String COMMAND_GET_FILE = "GetFile";
/** The get project command */
String COMMAND_GET_PROJECT = "GetProject"; String COMMAND_GET_PROJECT = "GetProject";
/** The checkout file command */
String COMMAND_CHECKOUT_FILE = "CheckOutFile"; String COMMAND_CHECKOUT_FILE = "CheckOutFile";
/** The checkout project command */
String COMMAND_CHECKOUT_PROJECT = "CheckOutProject"; String COMMAND_CHECKOUT_PROJECT = "CheckOutProject";
/** The checkin file command */
String COMMAND_CHECKIN_FILE = "CheckInFile"; String COMMAND_CHECKIN_FILE = "CheckInFile";
/** The checkin project command */
String COMMAND_CHECKIN_PROJECT = "CheckInProject"; String COMMAND_CHECKIN_PROJECT = "CheckInProject";
/** The get history command */
String COMMAND_HISTORY = "GetFileHistory"; String COMMAND_HISTORY = "GetFileHistory";
/** The add label command */
String COMMAND_LABEL = "AddLabel"; String COMMAND_LABEL = "AddLabel";
/** The project prefix */
String PROJECT_PREFIX = "$"; String PROJECT_PREFIX = "$";

// soscmd Option flags // soscmd Option flags
/** The command option */
String FLAG_COMMAND = "-command"; String FLAG_COMMAND = "-command";
/** The database (vss server) option */
String FLAG_VSS_SERVER = "-database"; String FLAG_VSS_SERVER = "-database";
/** The username option */
String FLAG_USERNAME = "-name"; String FLAG_USERNAME = "-name";
/** The password option */
String FLAG_PASSWORD = "-password"; String FLAG_PASSWORD = "-password";
/** The log option */
String FLAG_COMMENT = "-log"; String FLAG_COMMENT = "-log";
/** The workdir option */
String FLAG_WORKING_DIR = "-workdir"; String FLAG_WORKING_DIR = "-workdir";
/** The recursive option */
String FLAG_RECURSION = "-recursive"; String FLAG_RECURSION = "-recursive";
/** The revision option */
String FLAG_VERSION = "-revision"; String FLAG_VERSION = "-revision";
/** The label option */
String FLAG_LABEL = "-label"; String FLAG_LABEL = "-label";
/** The no compression option */
String FLAG_NO_COMPRESSION = "-nocompress"; String FLAG_NO_COMPRESSION = "-nocompress";
/** The no cache option */
String FLAG_NO_CACHE = "-nocache"; String FLAG_NO_CACHE = "-nocache";
/** The server option */
String FLAG_SOS_SERVER = "-server"; String FLAG_SOS_SERVER = "-server";
/** The sos home option */
String FLAG_SOS_HOME = "-soshome"; String FLAG_SOS_HOME = "-soshome";
/** The project option */
String FLAG_PROJECT = "-project"; String FLAG_PROJECT = "-project";
/** The file option */
String FLAG_FILE = "-file"; String FLAG_FILE = "-file";
/** The verbose option */
String FLAG_VERBOSE = "-verbose"; String FLAG_VERBOSE = "-verbose";
} }

Loading…
Cancel
Save