org.purl.sword.client
Class ClientOptions

java.lang.Object
  extended by org.purl.sword.client.ClientOptions

public class ClientOptions
extends Object

List of options that are parsed from the command line.

Author:
Neil Taylor

Field Summary
static String TYPE_MULTI_POST
          Label for the multipost operation.
static String TYPE_POST
          Label for the post operation.
static String TYPE_SERVICE
          Label for the service operation.
 
Constructor Summary
ClientOptions()
           
 
Method Summary
 String getAccessType()
          Get the access type.
 boolean getChecksumError()
          Get the checksum error value.
 String getFilename()
          Get the name of the file to post.
 String getFiletype()
          Get the type of the file to post.
 String getFormatNamespace()
          Get the format namespace value.
 String getHref()
          Get the HREF of the service to access.
 Iterator<PostDestination> getMultiPost()
          Get the list of post destinations.
 String getOnBehalfOf()
          Get the onBehalfOf value.
 String getPassword()
          Get the password.
 String getProxyHost()
          Get the proxy host.
 int getProxyPort()
          Get the proxy port.
 String getSlug()
          Get the current slug header.
 String getUsername()
          Get the username.
 boolean isGuiMode()
          Determine if the tool is to be run in GUI mode.
 boolean isMd5()
          Get the MD5 setting.
 boolean isNoCapture()
          Determine if the noCapture option is set.
 boolean isNoOp()
          Determine if the NoOp header should be sent.
 boolean isVerbose()
          Determine if the verbose option is set.
 boolean parseOptions(String[] args)
          Parse the list of options contained in the specified array.
 void setAccessType(String accessType)
          Set the access type.
 void setChecksumError(boolean checksumError)
          Set the checksum error value.
 void setFilename(String filename)
          Set the name of the file to post.
 void setFiletype(String filetype)
          Set the type of the file to post.
 void setFormatNamespace(String formatNamespace)
          Set the format namespace value.
 void setGuiMode(boolean guiMode)
          Set the tool to run in GUI mode.
 void setHref(String href)
          Set the HREF of the service to access.
 void setMd5(boolean md5)
          Set the MD5 setting.
 void setNoOp(boolean noOp)
          Set the NoOp setting.
 void setOnBehalfOf(String onBehalfOf)
          Set the onBehalf of Value.
 void setPassword(String password)
          Set the password.
 void setProxyHost(String proxyHost)
          Set the proxy host.
 void setProxyPort(int proxyPort)
          Set the proxy port.
 void setSlug(String slug)
          Set the text that is to be used for the slug header.
 void setUsername(String username)
          Set the username.
 void setVerbose(boolean verbose)
          Set the verbose option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_SERVICE

public static final String TYPE_SERVICE
Label for the service operation.

See Also:
Constant Field Values

TYPE_POST

public static final String TYPE_POST
Label for the post operation.

See Also:
Constant Field Values

TYPE_MULTI_POST

public static final String TYPE_MULTI_POST
Label for the multipost operation.

See Also:
Constant Field Values
Constructor Detail

ClientOptions

public ClientOptions()
Method Detail

parseOptions

public boolean parseOptions(String[] args)
Parse the list of options contained in the specified array.

Parameters:
args - The array of options.
Returns:
True if the options were parsed successfully.

getAccessType

public String getAccessType()
Get the access type.

Returns:
The value, or null if the value is not set.

setAccessType

public void setAccessType(String accessType)
Set the access type.

Parameters:
accessType - The value, or null to clear the value.

getProxyHost

public String getProxyHost()
Get the proxy host.

Returns:
The value, or null if the value is not set.

setProxyHost

public void setProxyHost(String proxyHost)
Set the proxy host.

Parameters:
proxyHost - The value, or null to clear the value.

getProxyPort

public int getProxyPort()
Get the proxy port.

Returns:
The proxy port. Default value is 80.

setProxyPort

public void setProxyPort(int proxyPort)
Set the proxy port.

Parameters:
proxyPort - The proxy port.

getUsername

public String getUsername()
Get the username.

Returns:
The value, or null if the value is not set.

setUsername

public void setUsername(String username)
Set the username.

Parameters:
username - The value, or null to clear the value.

getPassword

public String getPassword()
Get the password.

Returns:
The value, or null if the value is not set.

setPassword

public void setPassword(String password)
Set the password.

Parameters:
password - The value, or null to clear the value.

getHref

public String getHref()
Get the HREF of the service to access.

Returns:
The value, or null if the value is not set.

setHref

public void setHref(String href)
Set the HREF of the service to access.

Parameters:
href - The value, or null to clear the value.

getFilename

public String getFilename()
Get the name of the file to post.

Returns:
The value, or null if the value is not set.

setFilename

public void setFilename(String filename)
Set the name of the file to post.

Parameters:
filename - The value, or null to clear the value.

getFiletype

public String getFiletype()
Get the type of the file to post.

Returns:
The filetype, or null if the value is not set.

setFiletype

public void setFiletype(String filetype)
Set the type of the file to post.

Parameters:
filetype - The value, or null to clear the value.

isGuiMode

public boolean isGuiMode()
Determine if the tool is to be run in GUI mode.

Returns:
True if the tool is set for GUI mode.

setGuiMode

public void setGuiMode(boolean guiMode)
Set the tool to run in GUI mode.

Parameters:
guiMode - True if the tool is to run in gui mode.

isMd5

public boolean isMd5()
Get the MD5 setting. True if the tool is to use MD5 for post operations.

Returns:
The MD5 setting.

setMd5

public void setMd5(boolean md5)
Set the MD5 setting.

Parameters:
md5 - True if the tool should use MD5 for post operations.

isNoOp

public boolean isNoOp()
Determine if the NoOp header should be sent.

Returns:
True if the header should be sent.

setNoOp

public void setNoOp(boolean noOp)
Set the NoOp setting.

Parameters:
noOp - True if the NoOp header should be used.

isVerbose

public boolean isVerbose()
Determine if the verbose option is set.

Returns:
True if verbose option is set.

setVerbose

public void setVerbose(boolean verbose)
Set the verbose option.

Parameters:
verbose - True if verbose should be set.

getOnBehalfOf

public String getOnBehalfOf()
Get the onBehalfOf value.

Returns:
The value, or null to clear the value.

setOnBehalfOf

public void setOnBehalfOf(String onBehalfOf)
Set the onBehalf of Value.

Parameters:
onBehalfOf - The value, or null to clear the value.

getFormatNamespace

public String getFormatNamespace()
Get the format namespace value.

Returns:
The value, or null if the value is not set.

setFormatNamespace

public void setFormatNamespace(String formatNamespace)
Set the format namespace value.

Parameters:
formatNamespace - The value, or null to clear the value.

getChecksumError

public boolean getChecksumError()
Get the checksum error value.

Returns:
True if an error should be introduced into the checksum.

setChecksumError

public void setChecksumError(boolean checksumError)
Set the checksum error value.

Parameters:
checksumError - True if the error should be introduced.

getSlug

public String getSlug()
Get the current slug header.

Returns:
The slug value, or null if the value is not set.

setSlug

public void setSlug(String slug)
Set the text that is to be used for the slug header.

Parameters:
slug - The value, or null to clear the value.

getMultiPost

public Iterator<PostDestination> getMultiPost()
Get the list of post destinations.

Returns:
An iterator over the list of PostDestination objects.

isNoCapture

public boolean isNoCapture()
Determine if the noCapture option is set. This indicates that the code should not attempt to redirect stdout and stderr to a different output destination. Intended for use in a GUI client.

Returns:
The noCapture setting. True if set.


Copyright © 2013 DuraSpace. All Rights Reserved.