public class RecentFiles extends Object
Constructor and Description |
---|
RecentFiles(Class className,
int maximumFile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFile(String path)
Add a new file in recent file history.
|
void |
close()
This method save the present recent file history in the preference.
|
List<String> |
getFiles()
This gives the file in descending order where order is according to the time it is added.
|
boolean |
isEmpty()
Check if file history is empty.
|
void |
removeAll()
Clear the previous recent file history.
|
void |
removeFile(String path)
Remove a file from recent file history.
|
public RecentFiles(Class className, int maximumFile)
className
- the class for which this Recentfiles object is created and it will be used
to create preference instance.maximumFile
- the number of recent files to remember.public void removeAll()
public boolean isEmpty()
public void addFile(String path)
path
- path to the file. this path means File#getPath() method returned String.public void removeFile(String path)
path
- path string to the file. this path means File#getPath() method returned String.public List<String> getFiles()
public void close() throws IOException
IOException
- if saving in preference doesn't success.Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.