2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
.cache
;
9 import gov
.nasa
.worldwind
.Configuration
;
10 import gov
.nasa
.worldwind
.avlist
.AVKey
;
11 import gov
.nasa
.worldwind
.util
.Logging
;
17 * @version $Id: BasicDataFileCache.java 3335 2007-10-19 04:05:22Z tgaskins $
19 public class BasicDataFileCache
extends AbstractFileCache
21 public BasicDataFileCache()
23 String cachePathName
= Configuration
.getStringValue(AVKey
.DATA_FILE_CACHE_CONFIGURATION_FILE_NAME
);
24 if (cachePathName
== null)
26 String message
= Logging
.getMessage("FileCache.NoConfiguration");
27 Logging
.logger().severe(message
);
28 throw new IllegalStateException(message
);
31 java
.io
.InputStream is
= null;
32 File file
= new File(cachePathName
);
37 is
= new FileInputStream(file
);
39 catch (FileNotFoundException e
)
41 String message
= Logging
.getMessage("FileCache.LocalConfigFileNotFound", cachePathName
);
42 Logging
.logger().finest(message
);
48 is
= this.getClass().getClassLoader().getResourceAsStream(cachePathName
);
53 String message
= Logging
.getMessage("FileCache.ConfigurationNotFound", cachePathName
);
54 Logging
.logger().severe(message
);
55 throw new IllegalStateException(message
);