Author: kono
Date: 2012-07-23 14:48:13 -0700 (Mon, 23 Jul 2012)
New Revision: 29962
Modified:
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/RecentlyOpenedTrackerImpl.java
Log:
Number of max record had been increased to 10.
Modified:
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/RecentlyOpenedTrackerImpl.java
===================================================================
---
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/RecentlyOpenedTrackerImpl.java
2012-07-23 19:48:53 UTC (rev 29961)
+++
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/RecentlyOpenedTrackerImpl.java
2012-07-23 21:48:13 UTC (rev 29962)
@@ -13,16 +13,13 @@
import org.cytoscape.application.CyApplicationConfiguration;
import org.cytoscape.io.util.RecentlyOpenedTracker;
-import org.cytoscape.property.CyProperty;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RecentlyOpenedTrackerImpl implements RecentlyOpenedTracker {
- private static final int MAX_TRACK_COUNT = 5;
- private static final String USER_HOME_DIR =
System.getProperty("user.home");
+ private static final int MAX_TRACK_COUNT = 10;
private static final Logger logger =
LoggerFactory.getLogger(RecentlyOpenedTrackerImpl.class);
private final String trackerFileName;
@@ -41,12 +38,13 @@
this.propDir = config.getConfigurationDirectoryLocation();
this.trackerURLs = new LinkedList<URL>();
+ BufferedReader reader = null;
try {
final File input = new File(propDir, trackerFileName);
if (!input.exists())
input.createNewFile();
- final BufferedReader reader = new BufferedReader(new
FileReader(input));
+ reader = new BufferedReader(new FileReader(input));
String line;
while ((line = reader.readLine()) != null &&
trackerURLs.size() < MAX_TRACK_COUNT) {
final String newURL = line.trim();
@@ -55,6 +53,15 @@
}
} catch (IOException ioe) {
logger.warn("problem reading Recently Opened File
list",ioe);
+ } finally {
+ if(reader != null) {
+ try {
+ reader.close();
+ reader = null;
+ } catch (IOException e) {
+ logger.error("Colud not close the
reader for RecentlyOpenedTracker.",e);
+ }
+ }
}
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.