mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Updated CifsMounter to be able to connect from linux to an Alfresco CIFS server that is only running on NetBIOS.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4842 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -56,8 +56,9 @@ public class CifsMounter {
|
||||
|
||||
private static final String LinuxMountSmbfsCmd = "mount -t smbfs //${srvname}/${sharename} ${mountpoint} -o username=${username},password=${password}";
|
||||
private static final String LinuxMountCifsCmd = "mount -t cifs //${srvname}/${sharename} ${mountpoint} -o username=${username},password=${password}";
|
||||
private static final String LinuxMountCifsNBCmd = "mount.cifs //${srvname}/${sharename} ${mountpoint} -o servern=${srvname},port=139,username=${username},password=${password}";
|
||||
private static final String LinuxUnMountCmd = "umount ${mountpoint}";
|
||||
|
||||
|
||||
// Mac OS X mount/unmount commands
|
||||
|
||||
private static final String MacOSXMountCmd = "mount_smbfs -U ${username} //${password}@${srvname}/${sharename} ${mountpoint}";
|
||||
@@ -68,6 +69,10 @@ public class CifsMounter {
|
||||
private String m_srvName;
|
||||
private String m_shareName;
|
||||
|
||||
// Server address
|
||||
|
||||
private String m_srvAddr;
|
||||
|
||||
// Access details for remote share
|
||||
|
||||
private String m_userName;
|
||||
@@ -159,9 +164,19 @@ public class CifsMounter {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the command line to use the older smbfs VFS mounter to connect using NetBIOS
|
||||
// Set the command line to use the CIFS VFS mounter to connect using NetBIOS
|
||||
|
||||
commandMap.put( "Linux", LinuxMountSmbfsCmd);
|
||||
StringBuilder cmd = new StringBuilder( LinuxMountCifsNBCmd);
|
||||
|
||||
if ( getServerAddress() != null)
|
||||
{
|
||||
cmd.append( ",ip=");
|
||||
cmd.append( getServerAddress());
|
||||
}
|
||||
|
||||
// Set the command line
|
||||
|
||||
commandMap.put( "Linux", cmd.toString());
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -287,6 +302,16 @@ public class CifsMounter {
|
||||
{
|
||||
return m_srvName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return hte server address
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public final String getServerAddress()
|
||||
{
|
||||
return m_srvAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the share name
|
||||
@@ -348,6 +373,16 @@ public class CifsMounter {
|
||||
m_srvName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the server address
|
||||
*
|
||||
* @param srvAddr String
|
||||
*/
|
||||
public final void setServerAddress(String srvAddr)
|
||||
{
|
||||
m_srvAddr = srvAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the share name
|
||||
*
|
||||
|
Reference in New Issue
Block a user