Package com.mapr.cli.table
Class RecentTablesListManager
- java.lang.Object
-
- com.mapr.cli.table.RecentTablesListManager
-
- Direct Known Subclasses:
RecentStreamsListManager
public class RecentTablesListManager extends java.lang.Object- Manages the recent tables list of a user. - Persists the list to /user//.recent_tables file. - Limits the number of entries in this file to MAX_RECENT_TABLES_LIST_SIZEAuthor: smarella
-
-
Constructor Summary
Constructors Constructor Description RecentTablesListManager(java.lang.String user)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String newTable)Adds {@param newTable} to the top of recent tables list.voiddelete(java.lang.String tablePath)Deletes {@param tablePath} from the recent tables list.voiddeleteIfNotExist(java.lang.String tablePath, com.mapr.fs.MapRFileSystem mfs)protected java.lang.StringgetHomeDir()java.util.List<java.lang.String>getListFromFile()protected java.lang.StringgetPathForRecentList()booleanhasHomeDir()Check ifuserhas a home directory or not.voidmoveToTop(java.lang.String mostRecentTable)Move up the {@param mostRecentTable} to the top of the recent tables list, if it exists.
-
-
-
Method Detail
-
hasHomeDir
public boolean hasHomeDir()
Check ifuserhas a home directory or not.- Returns:
-
add
public void add(java.lang.String newTable)
Adds {@param newTable} to the top of recent tables list. Keeps the list size toMAX_RECENT_TABLES_LIST_SIZE- Parameters:
newTable-
-
moveToTop
public void moveToTop(java.lang.String mostRecentTable)
Move up the {@param mostRecentTable} to the top of the recent tables list, if it exists. Else, add it to the top of the list.- Parameters:
mostRecentTable-
-
delete
public void delete(java.lang.String tablePath)
Deletes {@param tablePath} from the recent tables list.- Parameters:
tablePath-
-
deleteIfNotExist
public void deleteIfNotExist(java.lang.String tablePath, com.mapr.fs.MapRFileSystem mfs)
-
getListFromFile
public java.util.List<java.lang.String> getListFromFile()
-
getPathForRecentList
protected java.lang.String getPathForRecentList()
-
getHomeDir
protected java.lang.String getHomeDir()
-
-