src/org/jnetpcap/util/resolver/AbstractResolver.java
public int saveCache() throws IOException {
		timeoutCache();

		if (saveCache == false || isModified == false || timeoutQueue.isEmpty()) {
			return 0;
		}

		URL url = JConfig.getURL(this.name, RESOLVER_SEARCH_PATH_PROPERTY);

		if (url == null) {
			logger.fine("cache file " + name + " not found");

			File dir = JConfig.getDir(PROPERTY_RESOLVER_HOME_SEARCH_PATH);
			if (dir == null) {
				logger.fine("cache directory not found");

				if (mkdirHome == true) {

					logger.fine("attempting to create cache directory using property "
							+ PROPERTY_RESOLVER_HOME);
					dir = JConfig.createDir(PROPERTY_RESOLVER_HOME, DEFAULT_HOME);
					if (dir == null) {
						return 0;
					}
				} else {
					logger.finer("property resolver.home.mkdir set to false, giving up");
					return 0;
				}
			}
			url = new File(dir, filename()).toURI().toURL();
		}

		logger.finer("saving cache " + url.toString());

		int count =
				saveCache(new PrintWriter(new OutputStreamWriter(new FileOutputStream(
						url.getFile()))));
		if (count == 0) {
			throw new IllegalStateException("Saved empty cache");
		}

		return count;
	}
/**
	 * Save the cache using default mechanism, if set.
	 * 
	 * @return number of cache entries saved
	 * @throws IOException
	 *           Signals that an I/O exception has occurred.
	 */
Save the cache using default mechanism, if set.

@return number of cache entries saved
@throws IOException
Signals that an I/O exception has occurred.
Save the cache using default mechanism if set . @return number of cache entries saved @throws IOException Signals that an I / O exception has occurred .
public int saveCache() throws IOException {
		timeoutCache();
		if (saveCache == false || isModified == false || timeoutQueue.isEmpty()) {
			return 0;
		}
		URL url = JConfig.getURL(this.name, RESOLVER_SEARCH_PATH_PROPERTY);
		if (url == null) {
			logger.fine("cache file " + name + " not found");
			File dir = JConfig.getDir(PROPERTY_RESOLVER_HOME_SEARCH_PATH);
			if (dir == null) {
				logger.fine("cache directory not found");
				if (mkdirHome == true) {
					logger.fine("attempting to create cache directory using property "
							+ PROPERTY_RESOLVER_HOME);
					dir = JConfig.createDir(PROPERTY_RESOLVER_HOME, DEFAULT_HOME);
					if (dir == null) {
						return 0;
					}
				} else {
					logger.finer("property resolver.home.mkdir set to false, giving up");
					return 0;
				}
			}
			url = new File(dir, filename()).toURI().toURL();
		}
		logger.finer("saving cache " + url.toString());
		int count =
				saveCache(new PrintWriter(new OutputStreamWriter(new FileOutputStream(
						url.getFile()))));
		if (count == 0) {
			throw new IllegalStateException("Saved empty cache");
		}
		return count;
	}
public int saveCache ( ) throws IOException { timeoutCache ( ) ; if ( saveCache == false || isModified == false || timeoutQueue . isEmpty ( ) ) { return 0 ; } URL url = JConfig . getURL ( this . name , RESOLVER_SEARCH_PATH_PROPERTY ) ; if ( url == null ) { logger . fine ( "cache file " + name + " not found" ) ; File dir = JConfig . getDir ( PROPERTY_RESOLVER_HOME_SEARCH_PATH ) ; if ( dir == null ) { logger . fine ( "cache directory not found" ) ; if ( mkdirHome == true ) { logger . fine ( "attempting to create cache directory using property " + PROPERTY_RESOLVER_HOME ) ; dir = JConfig . createDir ( PROPERTY_RESOLVER_HOME , DEFAULT_HOME ) ; if ( dir == null ) { return 0 ; } } else { logger . finer ( "property resolver.home.mkdir set to false, giving up" ) ; return 0 ; } } url = new File ( dir , filename ( ) ) . toURI ( ) . toURL ( ) ; } logger . finer ( "saving cache " + url . toString ( ) ) ; int count = saveCache ( new PrintWriter ( new OutputStreamWriter ( new FileOutputStream ( url . getFile ( ) ) ) ) ) ; if ( count == 0 ) { throw new IllegalStateException ( "Saved empty cache" ) ; } return count ; }
Save the cache using default mechanism, if set.
Save the cache using default mechanism if set .