diff options
author | kitfox | 2014-02-06 18:27:31 +0100 |
---|---|---|
committer | kitfox | 2014-02-06 18:27:31 +0100 |
commit | 34f578db7f7881962be6e5d69241875ab9f10f11 (patch) | |
tree | 5604994c38fd60fa525da4a0939e74a897fc16e0 | |
parent | Fixing SVGSALAMANDER-32. Adding a variety of automatic scaling options to SV... (diff) | |
download | svg-salamander-core-34f578db7f7881962be6e5d69241875ab9f10f11.tar.gz svg-salamander-core-34f578db7f7881962be6e5d69241875ab9f10f11.tar.xz svg-salamander-core-34f578db7f7881962be6e5d69241875ab9f10f11.zip |
Fixing SVGSALAMANDER-33. User can now selectively remove documents from cache.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@169 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rw-r--r-- | src/main/java/com/kitfox/svg/SVGUniverse.java | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/src/main/java/com/kitfox/svg/SVGUniverse.java b/src/main/java/com/kitfox/svg/SVGUniverse.java index b6859b9..5f6a2cd 100644 --- a/src/main/java/com/kitfox/svg/SVGUniverse.java +++ b/src/main/java/com/kitfox/svg/SVGUniverse.java @@ -54,6 +54,7 @@ import java.net.MalformedURLException; import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
@@ -624,45 +625,24 @@ public class SVGUniverse implements Serializable return null;
}
-// public static void main(String argv[])
-// {
-// try
-// {
-// URL url = new URL("svgSalamander", "localhost", -1, "abc.svg",
-// new URLStreamHandler()
-// {
-// protected URLConnection openConnection(URL u)
-// {
-// return null;
-// }
-// }
-// );
-//// URL url2 = new URL("svgSalamander", "localhost", -1, "abc.svg");
-//
-// //Investigate URI resolution
-// URI uriA, uriB, uriC, uriD, uriE;
-//
-// uriA = new URI("svgSalamander", "/names/mySpecialName", null);
-//// uriA = new URI("http://www.kitfox.com/salamander");
-//// uriA = new URI("svgSalamander://mySpecialName/grape");
-// System.err.println(uriA.toString());
-// System.err.println(uriA.getScheme());
-//
-// uriB = uriA.resolve("#begin");
-// System.err.println(uriB.toString());
-//
-// uriC = uriA.resolve("tree#boing");
-// System.err.println(uriC.toString());
-//
-// uriC = uriA.resolve("../tree#boing");
-// System.err.println(uriC.toString());
-// }
-// catch (Exception e)
-// {
-// Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
-// "Could not parse", e);
-// }
-// }
+ /**
+ * Get list of uris of all loaded documents and subdocuments.
+ * @return
+ */
+ public ArrayList getLoadedDocumentURIs()
+ {
+ return new ArrayList(loadedDocs.keySet());
+ }
+
+ /**
+ * Remove loaded document from cache.
+ * @param uri
+ */
+ public void removeDocument(URI uri)
+ {
+ loadedDocs.remove(uri);
+ }
+
public boolean isVerbose()
{
return verbose;
|