public class Win32Utils extends Object
Constructor and Description |
---|
Win32Utils() |
Modifier and Type | Method and Description |
---|---|
static int |
DeleteNetworkDrive(String devName,
boolean updProfile,
boolean force)
Disconnect a mapped drive and delete the local drive.
|
static int |
MapNetworkDrive(String remPath,
String localDev,
String userName,
String password,
boolean interactive,
boolean prompt)
Map a network drive optinally assigning a local drive letter to the mapped drive.
|
static boolean |
SetWorkingSetSize(long minSize,
long maxSize)
Set the process working set size so that the Java VM does not get swapped out of memory.
|
public static boolean SetWorkingSetSize(long minSize, long maxSize)
Setting a value of -1 for the minSize or maxSize can force the Java process to be swapped out of memory.
minSize
- longmaxSize
- longpublic static int MapNetworkDrive(String remPath, String localDev, String userName, String password, boolean interactive, boolean prompt)
remPath
- UNC path to the remote disk share to map tolocalDev
- Local device name (such as 'Z:') to map the remote share touserName
- If null the default username is used.password
- If null the default password is used, if an empty string then no password is used.interactive
- If true Windows can display a dialog to prompt for the username/password if the
specified username/password are not valid.prompt
- If true then always allow the user to override the specified username/password.public static int DeleteNetworkDrive(String devName, boolean updProfile, boolean force)
devName
- Either the remote UNC path or the local drive nameupdProfile
- If true then the user profile is updated to indicate the mapped drive is no longer
persistent and will not be restored next time the user logs onforce
- If true the drive is disconnected even if there are open filesCopyright © 2005–2018 Alfresco Software. All rights reserved.