Class ClientUtils
- java.lang.Object
-
- com.inductiveautomation.snap.filedata.ClientUtils
-
public class ClientUtils extends java.lang.ObjectSome utility methods for Snap.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.FilegetHomeDir(boolean doCreate)Returns the SnapCode directory in user's home directory.static java.lang.StringgetHostUserName(java.lang.String aUrl)Returns the user name for a site/host, if previously entered/recorded.static java.util.List<java.lang.String>getKnownSites()Returns a list of known sites.static java.lang.StringgetPassword(java.lang.String aSourceId)Returns the password for (site) URL, if previously entered/recorded.static java.util.List<SnapTableView>getTableViews(SnapSite aSite)Returns the list of known table views for this site.static SettingsgetUserLocalSettings()Returns the settings.static java.lang.StringgetUserName(java.lang.String aSourceId)Returns the user name for (site) URL, if previously entered/recorded.static voidsaveUserLocalSettings()Saves the settings.static booleansetAccess(WebSite aSite)Sets login info for given URL (if different than what has been previously saved for URL).static voidsetAccess(WebSite aSite, java.lang.String aUserName, java.lang.String aPW)Sets the access info for given URL to system.
-
-
-
Method Detail
-
getUserLocalSettings
public static Settings getUserLocalSettings()
Returns the settings.
-
saveUserLocalSettings
public static void saveUserLocalSettings()
Saves the settings.
-
getHomeDir
public static java.io.File getHomeDir(boolean doCreate)
Returns the SnapCode directory in user's home directory.
-
getTableViews
public static java.util.List<SnapTableView> getTableViews(SnapSite aSite)
Returns the list of known table views for this site.
-
setAccess
public static boolean setAccess(WebSite aSite)
Sets login info for given URL (if different than what has been previously saved for URL).- Returns:
- Whether login info was different than URL data source.
-
setAccess
public static void setAccess(WebSite aSite, java.lang.String aUserName, java.lang.String aPW)
Sets the access info for given URL to system.
-
getUserName
public static java.lang.String getUserName(java.lang.String aSourceId)
Returns the user name for (site) URL, if previously entered/recorded.
-
getPassword
public static java.lang.String getPassword(java.lang.String aSourceId)
Returns the password for (site) URL, if previously entered/recorded.
-
getHostUserName
public static java.lang.String getHostUserName(java.lang.String aUrl)
Returns the user name for a site/host, if previously entered/recorded.
-
getKnownSites
public static java.util.List<java.lang.String> getKnownSites()
Returns a list of known sites.
-
-