Class ClientUtils
- java.lang.Object
-
- com.inductiveautomation.snap.filedata.ClientUtils
-
public class ClientUtils extends java.lang.Object
Some utility methods for Snap.
-
-
Constructor Summary
Constructors Constructor Description ClientUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.File
getHomeDir(boolean doCreate)
Returns the SnapCode directory in user's home directory.static java.lang.String
getHostUserName(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.String
getPassword(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 Settings
getUserLocalSettings()
Returns the settings.static java.lang.String
getUserName(java.lang.String aSourceId)
Returns the user name for (site) URL, if previously entered/recorded.static void
saveUserLocalSettings()
Saves the settings.static boolean
setAccess(WebSite aSite)
Sets login info for given URL (if different than what has been previously saved for URL).static void
setAccess(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.
-
-