com.starla.smb
Class PCShare

java.lang.Object
  |
  +--com.starla.smb.PCShare

public final class PCShare
extends java.lang.Object

PC share class. The PC share class holds the details of a network share, including the required username and password access control.


Constructor Summary
PCShare()
          Construct an empty PCShare object.
PCShare(java.lang.String netpath)
          Construct a PCShare using the supplied UNC path.
PCShare(java.lang.String nname, java.lang.String shr, java.lang.String uname, java.lang.String pwd)
          Construct a PCShare using the specified remote server and access control details.
 
Method Summary
 java.lang.String getFileName()
          Get the remote file name string.
 java.lang.String getNetworkPath()
          Return the full UNC path for this PC share object.
 java.lang.String getNodeName()
          Get the remote node name string.
 java.lang.String getPassword()
          Get the remote password required to access the remote share.
 java.lang.String getPath()
          Get the share relative path string.
 java.lang.String getRelativePath()
          Return the share relative path for this PC share object.
 java.lang.String getShareName()
          Get the remote share name string.
 java.lang.String getUserName()
          Get the remote user name string.
static java.lang.String makePath(java.lang.String workdir, java.lang.String fname)
          Build a share relative path using the supplied working directory and file name.
 void setFileName(java.lang.String fn)
          Set the remote file name string.
 void setNetworkPath(java.lang.String netpath)
          Set the PC share from the supplied UNC path string.
 void setNodeName(java.lang.String nname)
          Set the remote node name string.
 void setPassword(java.lang.String pwd)
          Set the remote password string.
 void setPath(java.lang.String pth)
          Set the share relative path string.
 void setShareName(java.lang.String shr)
          Set the remote share name string.
 void setUserName(java.lang.String uname)
          Set the remote user name string.
 java.lang.String toString()
          Return the PCShare object as a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PCShare

public PCShare()
Construct an empty PCShare object.

PCShare

public PCShare(java.lang.String netpath)
        throws InvalidUNCPathException
Construct a PCShare using the supplied UNC path.
Parameters:
netpath - Network path of the remote server, in UNC format ie. \\node\\share.
Throws:
InvalidUNCPathException - If the network path is invalid.

PCShare

public PCShare(java.lang.String nname,
               java.lang.String shr,
               java.lang.String uname,
               java.lang.String pwd)
Construct a PCShare using the specified remote server and access control details.
Parameters:
nname - Node name of the remote server.
shr - Share name on the remote server.
uname - User name used to access the remote share.
pwd - Password used to access the remote share.
Method Detail

getFileName

public final java.lang.String getFileName()
Get the remote file name string.
Returns:
Remote file name string.

getNetworkPath

public final java.lang.String getNetworkPath()
Return the full UNC path for this PC share object.
Returns:
Path string of the remote share/path/file in UNC format, ie. \\node\share\path\file.

getNodeName

public final java.lang.String getNodeName()
Get the remote node name string.
Returns:
Node name string.

getPassword

public final java.lang.String getPassword()
Get the remote password required to access the remote share.
Returns:
Remote password string.

getPath

public final java.lang.String getPath()
Get the share relative path string.
Returns:
Share relative path string.

getRelativePath

public final java.lang.String getRelativePath()
Return the share relative path for this PC share object.
Returns:
Path string of the remote share/path/file relative to the share, ie. \path\file.

getShareName

public final java.lang.String getShareName()
Get the remote share name string.
Returns:
Remote share name string.

getUserName

public final java.lang.String getUserName()
Get the remote user name string.
Returns:
Remote user name string required to access the remote share.

makePath

public static java.lang.String makePath(java.lang.String workdir,
                                        java.lang.String fname)
Build a share relative path using the supplied working directory and file name.
Parameters:
workdir - Working directory string, relative to the root of the share.
fname - File name string.
Returns:
Share relative path string.

setFileName

public final void setFileName(java.lang.String fn)
Set the remote file name string.
Parameters:
fn - Remote file name string.

setNetworkPath

public final void setNetworkPath(java.lang.String netpath)
                          throws InvalidUNCPathException
Set the PC share from the supplied UNC path string.
Parameters:
netpath - UNC format remote file path.

setNodeName

public final void setNodeName(java.lang.String nname)
Set the remote node name string.
Parameters:
nname - Remote node name string.

setPassword

public final void setPassword(java.lang.String pwd)
Set the remote password string.
Parameters:
pwd - Remote password string, required to access the remote share.

setPath

public final void setPath(java.lang.String pth)
Set the share relative path string.
Parameters:
pth - Share relative path string.

setShareName

public final void setShareName(java.lang.String shr)
Set the remote share name string.
Parameters:
shr - Remote share name string.

setUserName

public final void setUserName(java.lang.String uname)
Set the remote user name string.
Parameters:
uname - Remote user name string.

toString

public final java.lang.String toString()
Return the PCShare object as a string
Returns:
PCShare string.
Overrides:
toString in class java.lang.Object